-
Notifications
You must be signed in to change notification settings - Fork 72
131 lines (109 loc) · 4.76 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build
on:
# Build on new commits, tags, or pull requests.
create:
push:
pull_request:
schedule:
# Run every week just to make sure the CI environment still works.
- cron: '0 0 * * 0'
jobs:
build-ubuntu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Apt Dependencies
run: sudo apt update && sudo apt install ninja-build qt6-base-dev libglx-dev libgl1-mesa-dev qt6-tools-dev qt6-l10n-tools libboost-dev libboost-date-time-dev libboost-iostreams-dev nlohmann-json3-dev libasound2-dev librtmidi-dev libpugixml-dev libminizip-dev doctest-dev
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Generate Project
working-directory: ${{runner.workspace}}/build
# We could use the -S and -B options, but we only have CMake 3.12 here.
run: cmake ${GITHUB_WORKSPACE} -G Ninja -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
- name: Build
run: ninja -C ${{runner.workspace}}/build
- name: Test
run: ${{runner.workspace}}/build/bin/pte_tests
build-osx:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Version number
id: version
run: echo "::set-output name=VERSION_ID::$(git describe --tags --long --always)"
- name: Install Dependencies
# Note: remove existing Github actions python to work around conflicts (https://github.com/actions/setup-python/issues/577)
run: |
rm /usr/local/bin/2to3*
rm /usr/local/bin/idle3*
rm /usr/local/bin/pydoc3*
rm /usr/local/bin/python3*
brew install --overwrite boost cmake doctest minizip ninja nlohmann-json pugixml qt6 pugixml rtmidi
- name: Generate Project
run: cmake -S ${GITHUB_WORKSPACE} -B ${{runner.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt6/lib/cmake
- name: Build
run: cmake --build ${{runner.workspace}}/build
- name: Test
run: ${{runner.workspace}}/build/bin/pte_tests
# Skip building the installer for PRs, since code signing / notarizing requires access to the repo's secrets.
- name: Add Certificates to Keychain
if: github.event_name != 'pull_request'
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }}
p12-password: ${{ secrets.MAC_CERTS_PASSWORD }}
- name: Build Installer
if: github.event_name != 'pull_request'
env:
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
run: cmake --build ${{runner.workspace}}/build --target package
- name: Upload Installer
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: powertabeditor-osx-${{ steps.version.outputs.VERSION_ID }}.dmg
path: ${{runner.workspace}}/build/powertabeditor-osx.dmg
if-no-files-found: error
build-windows:
runs-on: windows-2022
# Run both 32-bit and 64-bit builds.
strategy:
matrix:
arch: [x64, x86]
include:
- arch: x64
cmake_arch: x64
qt_arch: win64_msvc2019_64
- arch: x86
cmake_arch: Win32
qt_arch: win32_msvc2019
steps:
- uses: actions/checkout@v4
- name: Version number
id: version
run: echo "::set-output name=VERSION_ID::$(git describe --tags --long --always)"
- name: Install Dependencies
run: vcpkg install --triplet ${{ matrix.arch }}-windows boost-algorithm boost-date-time boost-endian boost-functional boost-iostreams boost-rational boost-signals2 boost-stacktrace doctest minizip nlohmann-json pugixml
# Building Qt via vcpkg would take a while ...
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
arch: ${{ matrix.qt_arch }}
version: 6.7.2
- name: Generate Project
run: cmake -A ${{ matrix.cmake_arch }} -B ./build -DPTE_ENABLE_PCH=1 -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
- name: Build
run: cmake --build ./build --config Release
- name: Test
run: ./build/bin/pte_tests.exe
- name: Build Installer
run: |
choco install innosetup -y -v
iscc installer/windows/installer.iss
mv installer/windows/powertabeditor.exe installer/windows/powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe
path: installer/windows/powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe
if-no-files-found: error