-
Notifications
You must be signed in to change notification settings - Fork 24
290 lines (240 loc) · 8.64 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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
name: Build
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
build-windows:
runs-on: windows-latest
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "26.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install the Rust dependencies
run: cargo install 'flutter_rust_bridge_codegen' rinf protoc-gen-prost
- name: Activate Protobuf
run: flutter pub global activate protoc_plugin
- name: Flutter pub get
run: flutter pub get
- name: Generate message files
run: rinf message
- name: Build Windows
run: flutter build windows --release --verbose
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: build/windows/x64/runner/Release/
name: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-windows
release-windows:
permissions:
contents: write
needs: build-windows
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: Rune-*-windows
path: artifacts
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Build Zip for Release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-windows-amd64.zip
directory: artifacts
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/*.zip"
allowUpdates: true
replacesArtifacts: false
omitBodyDuringUpdate: true
makeLatest: true
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install liblmdb0 jq alsa-base alsa-source librust-alsa-sys-dev libasound2-dev liblmdb-dev clang cmake ninja-build pkg-config libgtk-3-dev dpkg-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "26.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install the Rust dependencies
run: cargo install 'flutter_rust_bridge_codegen' rinf protoc-gen-prost
- name: Activate Protobuf
run: flutter pub global activate protoc_plugin
- name: Flutter pub get
run: flutter pub get
- name: Generate message files
run: rinf message
- name: Build linux
run: flutter build linux --release --verbose
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: build/linux/x64/release/bundle/
name: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-linux
release-linux:
permissions:
contents: write
needs: build-linux
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: Rune-*-linux
path: artifacts
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Build Zip for Release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-linux-amd64.zip
directory: artifacts
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "artifacts/*.zip"
replacesArtifacts: false
omitBodyDuringUpdate: true
makeLatest: true
build-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "26.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Install certificates
env:
DEVELOPER_ID_APPLICATION_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_APPLICATION_P12_BASE64_MAC }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH=$RUNNER_TEMP/build_developerID_application_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/rune-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$DEVELOPER_ID_APPLICATION_P12_BASE64_MAC" | base64 --decode --output $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# security default-keychain -s $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
- name: All
run: |
brew install just
just macos-ci-all
env:
DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY: ${{ secrets.DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
REF_NAME: ${{ github.ref_name }}
SHA: ${{ steps.short-sha.outputs.sha }}
- name: Replace System Dylib
run: |
otool -L Rune.app/Contents/MacOS/Rune | grep lmdb
install_name_tool -change /opt/homebrew/opt/lmdb/lib/liblmdb.dylib @executable_path/../Frameworks/liblmdb.dylib Rune.app/Contents/MacOS/Rune
working-directory: build/macos/Build/Products/Release
- name: Upload artifact macOS DMG
uses: actions/upload-artifact@v4
with:
path: "temp_macos/*.dmg"
name: Rune-${{ github.ref_name }}-${{ steps.short-sha.outputs.sha }}-macOS
- name: Clean up
if: ${{ always() }}
run: |
just macos-ci-clean
if [ -f "$RUNNER_TEMP/rune-signing.keychain-db" ]; then
echo "$RUNNER_TEMP/rune-signing.keychain-db"
security delete-keychain $RUNNER_TEMP/rune-signing.keychain-db
fi
rm -f .env
release-macos:
permissions:
contents: write
needs: build-macos
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: Rune-*-macOS
path: artifacts
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/**/*.dmg"
allowUpdates: true
replacesArtifacts: false
omitBodyDuringUpdate: true
makeLatest: true