-
-
Notifications
You must be signed in to change notification settings - Fork 26
69 lines (59 loc) · 2.45 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
name: Build and publish a release
on:
# NOTE: We specifically do *not* support `workflow_dispatch` here, because if we run this from
# workflow_dispatch, it will create a tag & release named /refs/heads/master or similar.
# This is a pain to deal with and we can always just delete the tag and tag a later commit
# if we need to make fixes as part of the release process.
push:
tags:
- '*'
jobs:
run-tests:
uses: ./.github/workflows/run_tests.yml
build-release:
name: Build Release
runs-on: windows-latest
needs: run-tests
steps:
- name: Print installed Windows SDK versions
shell: pwsh
continue-on-error: true
run: Get-ChildItem -Name "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots"
- name: Add MSBuild to the PATH
uses: microsoft/setup-msbuild@v2
- name: Checkout code
uses: actions/checkout@v4
- name: Build 32-bit binary
run: msbuild /r /m /p:Configuration=Release /p:Platform=x86 build\foo_openlyrics.sln
- name: Build 64-bit binary
run: msbuild /r /m /p:Configuration=Release /p:Platform=x64 build\foo_openlyrics.sln
- name: Pack binary into archive
shell: bash
run: |
release_version="${GITHUB_REF#refs/tags/}"
release_name="foo_openlyrics-${release_version}"
echo "Release version ${release_version}"
mkdir -p build_component_staging/x64
pushd build_component_staging
cp "../build/Release/foo_openlyrics.dll" "."
cp "../build/x64/Release/foo_openlyrics.dll" "x64/"
7z a -tzip "../${release_name}.fb2k-component" "."
popd
mkdir -p build_symbols_staging/x86
mkdir -p build_symbols_staging/x64
pushd build_symbols_staging
cp "../build/Release/foo_openlyrics.dll" "x86/"
cp "../build/Release/foo_openlyrics.pdb" "x86/"
cp "../build/x64/Release/foo_openlyrics.dll" "x64/"
cp "../build/x64/Release/foo_openlyrics.pdb" "x64/"
7z a "../${release_name}-with_debug_symbols.zip" "."
popd
echo "RELEASE_VERSION=${release_version}" >> $GITHUB_ENV
echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV
- name: Create GitHub release
id: release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.RELEASE_NAME }}.fb2k-component
${{ env.RELEASE_NAME }}-with_debug_symbols.zip