-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (79 loc) · 3.01 KB
/
release.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release Workflow
on:
push:
tags: '*'
env:
RED3EXT_CONFIG: Release
RED3EXT_VERSION: ${{ github.ref_name }}
RED3EXT_HASH_ALGORITHM: SHA256
jobs:
release:
name: Release ${{ github.ref_name }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Create build directory
run: mkdir build
- name: Configure
working-directory: build
run: |
cmake `
-DRED3EXT_CI_RELEASE=ON `
-DRED3EXT_INSTALL=ON `
-DRED3EXT_EXTRA_WARNINGS=ON `
-DRED3EXT_TREAT_WARNINGS_AS_ERRORS=ON `
"${{ github.workspace }}"
- name: Build
working-directory: build
run: |
cmake `
--build . `
--config ${env:RED3EXT_CONFIG}
- name: Install
working-directory: build
run: |
cmake `
--install . `
--prefix "${{ github.workspace }}/build/install" `
--config ${env:RED3EXT_CONFIG}
- name: Copy license files
working-directory: build/install
run: |
Copy-Item -Path ../../LICENSE.md -Destination ./red3ext/LICENSE.txt
Copy-Item -Path ../../THIRD_PARTY_LICENSES.md -Destination ./red3ext/THIRD_PARTY_LICENSES.txt
- name: Create ZIP
working-directory: build/install
run: 7z a -r red3ext-${env:RED3EXT_VERSION}.zip *.dll *.txt
- name: Create symbols ZIP
working-directory: build/install
run: 7z a -r red3ext-symbols-${env:RED3EXT_VERSION}.zip *.pdb
- name: Compute ZIP's checksum
working-directory: build/install
run: |
$Hash = Get-FileHash -Algorithm ${env:RED3EXT_HASH_ALGORITHM} -Path red3ext-${env:RED3EXT_VERSION}.zip
$Hash | Format-List
$Checksum = $Hash | ForEach-Object { $_.Hash }
echo "RED3EXT_ZIP_SHA256=${Checksum}" | Out-File -FilePath ${env:GITHUB_ENV} -Encoding UTF8 -Append
- name: Compute symbols ZIP's checksum
working-directory: build/install
run: |
$Hash = Get-FileHash -Algorithm ${env:RED3EXT_HASH_ALGORITHM} -Path red3ext-symbols-${env:RED3EXT_VERSION}.zip
$Hash | Format-List
$Checksum = $Hash | ForEach-Object { $_.Hash }
echo "RED3EXT_SYMBOLS_SHA256=${Checksum}" | Out-File -FilePath ${env:GITHUB_ENV} -Encoding UTF8 -Append
- name: Upload assets
uses: softprops/action-gh-release@v1
with:
append_body: true
body: |
## Checksums
- red3ext-${{ env.RED3EXT_VERSION }}.zip
- **${{ env.RED3EXT_HASH_ALGORITHM }}**: ${{ env.RED3EXT_ZIP_SHA256 }}
- red3ext-symbols-${{ env.RED3EXT_VERSION }}.zip
- **${{ env.RED3EXT_HASH_ALGORITHM }}**: ${{ env.RED3EXT_SYMBOLS_SHA256 }}
files: |
build/install/red3ext-${{ env.RED3EXT_VERSION }}.zip
build/install/red3ext-symbols-${{ env.RED3EXT_VERSION }}.zip