-
Notifications
You must be signed in to change notification settings - Fork 0
471 lines (410 loc) · 16.7 KB
/
Copy pathrelease.yml
File metadata and controls
471 lines (410 loc) · 16.7 KB
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
name: Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. 0.3.1)"
required: true
type: string
release_name:
description: "Release title (leave blank to use tag as title)"
required: false
type: string
default: ""
jobs:
build:
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.experimental == true }}
strategy:
fail-fast: false
matrix:
include:
- name: windows-x86_64
runner: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: blockwork-windows-x86_64.exe
cef_windows_dir: cef_windows_x86_64
installer_arch: x64compatible
experimental: false
- name: windows-arm64
runner: windows-11-arm
target: aarch64-pc-windows-msvc
artifact_name: blockwork-windows-arm64.exe
cef_windows_dir: cef_windows_aarch64
installer_arch: arm64
experimental: true
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
artifact_name: blockwork-macos-arm64
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml
- name: Build (release, Windows)
if: runner.os == 'Windows'
run: cargo build --release --target ${{ matrix.target }} --workspace --exclude blockwork-linux-bridge
- name: Stage CEF runtime files (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$releaseDir = "target/${{ matrix.target }}/release"
$cefBuildDir = Get-ChildItem "$releaseDir/build" -Directory -Filter "cef-dll-sys-*" |
Sort-Object LastWriteTime -Descending | Select-Object -First 1
$cefRuntimeDir = Get-ChildItem (Join-Path $cefBuildDir.FullName "out") -Recurse -Directory -Filter "${{ matrix.cef_windows_dir }}" |
Select-Object -First 1
Get-ChildItem $cefRuntimeDir.FullName -File | Copy-Item -Destination $releaseDir -Force
Copy-Item (Join-Path $cefRuntimeDir.FullName "locales") $releaseDir -Recurse -Force
- name: Rename binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Copy-Item target/${{ matrix.target }}/release/blockwork.exe ${{ matrix.artifact_name }}
- name: Upload artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}
if-no-files-found: error
retention-days: 90
- name: Build macOS app bundle
if: runner.os == 'macOS'
run: ./scripts/build-macos-bundle.sh ${{ matrix.target }}
- name: Zip macOS app bundle
if: runner.os == 'macOS'
run: ditto -c -k --sequesterRsrc --keepParent dist/Blockwork.app ${{ matrix.artifact_name }}.app.zip
- name: Upload macOS app bundle
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}.app.zip
path: ${{ matrix.artifact_name }}.app.zip
if-no-files-found: error
retention-days: 90
- name: Locate or install Inno Setup
if: runner.os == 'Windows'
shell: pwsh
run: |
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
if (-not (Test-Path $iscc)) {
choco install innosetup -y
}
- name: Determine installer version
if: runner.os == 'Windows'
id: installer_version
shell: pwsh
run: |
$tag = "${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
$version = $tag -replace '^v', ''
echo "value=$version" >> $env:GITHUB_OUTPUT
- name: Build installer (Inno Setup)
if: runner.os == 'Windows'
shell: pwsh
run: |
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
& $iscc "/DMyAppVersion=${{ steps.installer_version.outputs.value }}" "/DTargetTriple=${{ matrix.target }}" "/DInstallerArch=${{ matrix.installer_arch }}" "/DOutputBaseFilename=blockwork-${{ matrix.name }}-setup" installer\blockwork.iss
- name: Upload installer artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: blockwork-${{ matrix.name }}-setup.exe
path: dist/blockwork-${{ matrix.name }}-setup.exe
if-no-files-found: error
retention-days: 90
- name: Build MSIX (Microsoft Store)
if: matrix.name == 'windows-x86_64'
shell: pwsh
run: ./scripts/build-msix.ps1 -Version "${{ steps.installer_version.outputs.value }}" -Target ${{ matrix.target }} -Arch x64
- name: Upload MSIX artifact
if: matrix.name == 'windows-x86_64'
uses: actions/upload-artifact@v4
with:
name: blockwork-windows-x86_64.msix
path: dist/blockwork-windows-x86_64.msix
if-no-files-found: error
retention-days: 90
linux-appimage:
name: AppImage (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: blockwork-linux-x86_64
linux_arch: x86_64
- name: linux-arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
artifact_name: blockwork-linux-arm64
linux_arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install Linux system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
pkg-config \
build-essential \
curl \
wget \
file \
libssl-dev \
libxdo-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libwebkit2gtk-4.1-dev \
libdbus-1-dev \
libxkbcommon-dev \
libxkbcommon-x11-0 \
libx11-dev \
libx11-xcb-dev \
libxtst-dev \
libwayland-dev \
wayland-protocols \
libclang-dev
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: ui/package.json
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml
- name: Build (release)
run: cargo build --release --target ${{ matrix.target }}
- name: Stage CEF runtime files
run: |
releaseDir="target/${{ matrix.target }}/release"
cefBuildDir=$(ls -dt "$releaseDir"/build/cef-dll-sys-*/ | head -1)
cefRuntimeDir=$(find "${cefBuildDir}out" -maxdepth 2 -type d -name "cef_linux_${{ matrix.linux_arch }}" | head -1)
find "$cefRuntimeDir" -maxdepth 1 -type f -exec cp -f {} "$releaseDir/" \;
cp -r "$cefRuntimeDir/locales" "$releaseDir/"
- name: Rename binary
run: cp target/${{ matrix.target }}/release/blockwork ${{ matrix.artifact_name }}
- name: Build AppImage
run: |
export APPIMAGE_EXTRACT_AND_RUN=1
wget -q -O linuxdeploy.AppImage "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${{ matrix.linux_arch }}.AppImage"
wget -q -O linuxdeploy-plugin-appimage.AppImage "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-${{ matrix.linux_arch }}.AppImage"
chmod +x linuxdeploy.AppImage linuxdeploy-plugin-appimage.AppImage
mkdir -p appimage-staging
# Exec entry wants a binary named blockwork.
cp ${{ matrix.artifact_name }} appimage-staging/blockwork
# CEF runtime sits next to the binary in target/<triple>/release.
# linuxdeploy only finds libcef.so via ldd, so copy the rest by hand.
CEF_DIR="target/${{ matrix.target }}/release"
cp "$CEF_DIR/libcef.so" appimage-staging/
# Daemon ships next to blockwork in usr/bin.
cp "$CEF_DIR/blockwork-daemon" appimage-staging/
export LINUXDEPLOY_EXCLUDED_LIBRARIES="libnspr4.so;libplc4.so;libplds4.so;libnss3.so;libnssutil3.so;libsmime3.so"
./linuxdeploy.AppImage \
--appdir AppDir \
--executable ./appimage-staging/blockwork \
--executable ./appimage-staging/blockwork-daemon \
--desktop-file res/blockwork.desktop \
--icon-file res/icons/blockwork.png
cp "$CEF_DIR"/libEGL.so "$CEF_DIR"/libGLESv2.so "$CEF_DIR"/libvk_swiftshader.so \
"$CEF_DIR"/libvulkan.so.1 "$CEF_DIR"/vk_swiftshader_icd.json "$CEF_DIR"/chrome-sandbox \
"$CEF_DIR"/icudtl.dat "$CEF_DIR"/v8_context_snapshot.bin "$CEF_DIR"/chrome_100_percent.pak \
"$CEF_DIR"/chrome_200_percent.pak "$CEF_DIR"/resources.pak \
AppDir/usr/lib/
cp -r "$CEF_DIR/locales" AppDir/usr/lib/
./linuxdeploy.AppImage --appdir AppDir --output appimage
mv Blockwork*.AppImage ${{ matrix.artifact_name }}.AppImage
- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}.AppImage
path: ${{ matrix.artifact_name }}.AppImage
if-no-files-found: error
retention-days: 90
linux-flatpak:
name: Flatpak (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
runner: ubuntu-latest
artifact_name: blockwork-linux-x86_64
- name: linux-arm64
runner: ubuntu-24.04-arm
artifact_name: blockwork-linux-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Flatpak tooling
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends flatpak flatpak-builder elfutils
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user --noninteractive flathub \
org.gnome.Platform//50 org.gnome.Sdk//50 \
org.freedesktop.Sdk.Extension.rust-stable//25.08 org.freedesktop.Sdk.Extension.node24//25.08
- name: Build Flatpak
# Offline sandbox build, no host cargo build needed.
run: |
manifest=packaging/flatpak/com.blockworked.Blockwork
awk '
/# BEGIN app-source/ {
print
print " - type: dir"
print " path: ../.."
print " skip: [target, .git, .flatpak-builder, flatpak-build, flatpak-repo, node_modules, ui/node_modules, ui/dist, packaging/flatpak]"
skip = 1
next
}
/# END app-source/ { skip = 0 }
!skip
' "$manifest.yml" > "$manifest.local.yml"
flatpak-builder --force-clean --user --default-branch=stable --repo=flatpak-repo flatpak-build "$manifest.local.yml"
flatpak build-bundle flatpak-repo ${{ matrix.artifact_name }}.flatpak com.blockworked.Blockwork stable
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}.flatpak
path: ${{ matrix.artifact_name }}.flatpak
if-no-files-found: error
retention-days: 90
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [build, linux-appimage, linux-flatpak]
if: always()
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine release tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Determine release name
id: release_name
run: |
NAME="${{ inputs.release_name }}"
if [ -z "$NAME" ]; then
NAME="${{ steps.tag.outputs.value }}"
fi
echo "value=$NAME" >> "$GITHUB_OUTPUT"
- name: Build release notes from CHANGELOG.md
env:
TAG: ${{ steps.tag.outputs.value }}
run: |
VERSION="${TAG#v}"
awk -v ver="$VERSION" 'index($0, "## [" ver "]") == 1 {flag=1; print; next} flag && /^## \[/ {exit} flag' CHANGELOG.md > /tmp/changelog_section.md
if [ ! -s /tmp/changelog_section.md ]; then
echo "## $TAG" > /tmp/changelog_section.md
echo "" >> /tmp/changelog_section.md
echo "See commit history since the previous tag for details." >> /tmp/changelog_section.md
fi
{
cat /tmp/changelog_section.md
echo ""
echo "## Downloads"
echo ""
echo "| Platform | File |"
echo "|---|---|"
echo "| Windows x86_64 (installer) | \`blockwork-windows-x86_64-setup.exe\` |"
echo "| Windows x86_64 (portable exe) | \`blockwork-windows-x86_64.exe\` |"
echo "| Windows x86_64 (MSIX, for the Microsoft Store) | \`blockwork-windows-x86_64.msix\` |"
echo "| Windows arm64 (installer) | \`blockwork-windows-arm64-setup.exe\` |"
echo "| Windows arm64 (portable exe) | \`blockwork-windows-arm64.exe\` |"
echo "| Linux x86_64 (AppImage) | \`blockwork-linux-x86_64.AppImage\` |"
echo "| Linux x86_64 (Flatpak) | \`blockwork-linux-x86_64.flatpak\` |"
echo "| Linux arm64 (AppImage) | \`blockwork-linux-arm64.AppImage\` |"
echo "| Linux arm64 (Flatpak) | \`blockwork-linux-arm64.flatpak\` |"
echo "| macOS arm64 (app bundle, unsigned) | \`blockwork-macos-arm64.app.zip\` |"
} > RELEASE_BODY.md
cat RELEASE_BODY.md
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./release-artifacts
- name: List release artifacts
run: ls -lh ./release-artifacts/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.value }}
name: ${{ steps.release_name.outputs.value }}
draft: false
prerelease: false
fail_on_unmatched_files: false
files: ./release-artifacts/*
body_path: RELEASE_BODY.md
chocolatey:
name: Chocolatey
needs: [release]
uses: ./.github/workflows/chocolatey.yml
with:
tag: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
secrets: inherit
homebrew:
name: Homebrew
needs: [release]
uses: ./.github/workflows/homebrew.yml
with:
tag: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
secrets: inherit
winget:
name: Publish to winget
runs-on: windows-latest
needs: [release]
env:
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
steps:
# Updates an existing package; the first version is submitted by hand
- name: Open winget-pkgs PR
if: env.WINGET_TOKEN != ''
uses: vedantmgoyal9/winget-releaser@main
with:
identifier: Blockworked.Blockwork
release-tag: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
installers-regex: '-setup\.exe$'
token: ${{ secrets.WINGET_TOKEN }}