-
Notifications
You must be signed in to change notification settings - Fork 12
208 lines (183 loc) · 7.79 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
environment: Release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2022]
arch: [x64, arm64]
node-version: [20.x]
exclude:
- os: windows-2022
arch: arm64
- os: ubuntu-latest
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout submodules
shell: bash
run: |
git submodule update --init --remote backend/vcpkg
git submodule update --init --remote backend/extern/afv-native
git submodule update --init --remote backend/extern/libuiohook
cd backend/extern/afv-native
git checkout modern-chained-callback
cd ../libuiohook
git checkout unregister-hook-when-debugging
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.11.x"
- name: Update cmake
if: matrix.os != 'macos-latest'
run: |
pip install cmake
cmake --version
- name: Setup environment
if: matrix.os == 'macos-latest'
run: |
brew update
brew upgrade cmake
cmake --version
- name: Installing codesign certificates
if: matrix.os == 'macos-latest'
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CERT_DATA }}
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
- name: Install SFML native dependencies
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev pkg-config libxtst-dev libxinerama-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxkbfile-dev
- name: Replace repositories with amd64 and arm64 repositories
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=amd64] http://archive.canonical.com/ubuntu/ jammy partner" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
- name: Install cross-compilation to arm on linux dependencies
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
sudo apt-get remove libgpg-error-dev
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y desktop-file-utils ninja-build gcc-aarch64-linux-gnu:amd64 g++-aarch64-linux-gnu:amd64 python3-jinja2:amd64 libgcrypt20:arm64 libgcrypt20-dev:arm64 libgpg-error-dev:arm64 libx11-dev:arm64 libxrandr-dev:arm64 libxcursor-dev:arm64 libxi-dev:arm64 libudev-dev:arm64 libgl1-mesa-dev:arm64
- name: Install dependencies and building backend (x64)
if: matrix.arch == 'x64'
run: |
npm -g i cmake-js
cd backend/
npm install
cmake-js compile -B Release -a x64
node custom_build.mjs
npm pack
cd ..
npm install ./backend/trackaudio-afv-1.0.0.tgz
npm install
- name: Install dependencies and building backend (macOs arm64)
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest'
run: |
npm -g i cmake-js
cd backend/
npm install
cmake-js compile -B Release -a arm64
node custom_build.mjs
npm pack
cd ..
npm install ./backend/trackaudio-afv-1.0.0.tgz
npm install
- name: Install dependencies and building backend (linux arm64 cross compile)
if: matrix.arch == 'arm64' && matrix.os == 'ubuntu-latest'
run: |
npm -g i cmake-js
cd backend/
npm install
cmake-js compile -B Release -a arm64 --prefer-clang false --CD -DVCPKG_TARGET_TRIPLET=arm64-linux
node custom_build.mjs
npm pack
cd ..
npm install ./backend/trackaudio-afv-1.0.0.tgz
npm install
- name: Package app
if: matrix.os == 'windows-2022'
shell: bash
run: npm run build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install notarization tools
if: matrix.os == 'macos-latest'
run: |
cat << EOF > ./.a.p8
${{ secrets.APPLE_API_KEY }}
EOF
- name: Package app
if: matrix.os == 'macos-latest'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_API_KEY: "./.a.p8"
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: |
npm run build:mac -- --${{ matrix.arch }}
rm ./.a.p8
- name: Package app
if: matrix.os == 'ubuntu-latest'
shell: bash
run: npm run build:linux -- --${{ matrix.arch }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rename installer to human friendly name
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: |
cd dist/
dmg_file=$(find . -name "*.dmg" -type f)
new_dmg_file=$(echo $dmg_file | sed 's/arm64/apple-silicon/')
mv $dmg_file $new_dmg_file
- id: relinfo
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: pierr3/TrackAudio
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: softprops/action-gh-release@v2
if: matrix.os == 'windows-2022'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: |
dist/*.exe
dist/*.zip
- name: Upload artifacts
uses: softprops/action-gh-release@v2
if: matrix.os == 'macos-latest'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: "dist/*.dmg"
- name: Upload artifacts
uses: softprops/action-gh-release@v2
if: matrix.os == 'ubuntu-latest'
with:
tag_name: ${{ steps.relinfo.outputs.release }}
files: |
dist/*.deb
dist/*.AppImage
dist/*.zsync
dist/*.snap