-
-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (69 loc) · 2.54 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
82
83
84
85
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: windows-2022
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
configuration: ['Release', 'Debug']
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Set repo variable
run: |
$repo = "${{ github.repository }}".Split("/")[1]
echo "REPO=$repo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build Win32
run: msbuild /m '/p:Platform=Win32;Configuration=${{ matrix.configuration }}' src\${{ env.REPO }}.sln
- name: Build x64
run: msbuild /m '/p:Platform=x64;Configuration=${{ matrix.configuration }}' src\${{ env.REPO }}.sln
- name: Copy licenses
run: |
$LICENSE_DIR="component/licenses"
mkdir -Force "$LICENSE_DIR"
copy LICENSE.txt "$LICENSE_DIR\foo_listenbrainz2-license.txt"
copy foobar2000-sdk\sdk-license.txt "$LICENSE_DIR\foobar2000-sdk-license.txt"
copy foobar2000-sdk\libPPUI\libPPUI-license.txt "$LICENSE_DIR\libPPUI-license.txt"
copy foobar2000-sdk\nlohmann\LICENSE.MIT "$LICENSE_DIR\JSON-for-modern-C++-license.txt"
copy foobar2000-sdk\pfc\pfc-license.txt "$LICENSE_DIR\pfc-license.txt"
copy foobar2000-sdk\wtl\MS-PL.txt "$LICENSE_DIR\wtl-license.txt"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPO }}-${{ matrix.configuration }}
path: component/
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
steps:
- name: Set repo and version variable
run: |
echo "REPO=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- uses: actions/download-artifact@v1
with:
name: ${{ env.REPO }}-Release
path: artifacts/${{ env.REPO }}/
- name: Generate fb2k component package
run: |
mkdir artifacts/release/
cd artifacts/${{ env.REPO }}/
rm *.pdb
rm x64/*.pdb
zip -r ../release/${{ env.REPO }}-$VERSION.fb2k-component *
- name: Generate checksums
run: |
cd artifacts/release/
sha256sum * > SHA256SUMS
- name: Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}