forked from spelunky-fyi/overlunky
-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (69 loc) · 2.71 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Stable Build
on:
push:
tags:
- "*"
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: true
- name: Remove Strawberry Perl from PATH
run: |
$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", ""
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Get tags for release notes
shell: bash
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_INFO_DUMP=OFF -DBUILD_SPEL2_DLL=OFF
cmake --build . --config Release --target ALL_BUILD
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: Get release notes
id: get_message
shell: bash
run: |
content=$(git show -s --format=%s $(git describe) | tail -n +4 | head -n -1 | sed 's/^/- /')
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo $content
echo "::set-output name=NOTES::$content"
- name: Create artifacts
run: |
mkdir Overlunky
move build\bin\Release\Overlunky.dll Overlunky\Overlunky.dll
move build\bin\Release\Overlunky.exe Overlunky\Overlunky.exe
move README.md Overlunky\README.txt
move examples Overlunky\Scripts
7z a Overlunky_${{ steps.get_version.outputs.VERSION }}.zip Overlunky\
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Binary
path: ./Overlunky
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Discord
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
color: "#3377ff"
description: "Release notes: ```${{ steps.get_message.outputs.NOTES }}```"
details: "Download: **[Overlunky ${{ steps.get_version.outputs.VERSION }}](https://github.com/spelunky-fyi/overlunky/releases/download/${{ steps.get_version.outputs.VERSION }}/Overlunky_${{ steps.get_version.outputs.VERSION }}.zip)**"
text: A new version of Overlunky was just released!
footer: I thought you'd like to know :3
webhookUrl: https://canary.discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}