-
Notifications
You must be signed in to change notification settings - Fork 87
351 lines (310 loc) · 12 KB
/
release.yml
File metadata and controls
351 lines (310 loc) · 12 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
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
env:
BINARY_NAME: plumeimpactor
BINARY_NAME_CLI: plumesign
BUNDLE_NAME: Impactor
jobs:
build-linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-24.04
arch: x86_64
- os: ubuntu-24.04-arm
arch: aarch64
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Use Wild linker
uses: davidlattimore/wild-action@latest
- uses: snok/install-poetry@v1
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install and cache apt pkgs
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: flatpak flatpak-builder libglib2.0-dev libsecret-1-dev libgtk-3-dev libpng-dev libjpeg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libexpat1-dev libtiff-dev libxdo-dev libappindicator3-dev
version: 1.0
- name: Build binaries
run: |
make linux PROFILE=release APPIMAGE=1
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-linux-${{ matrix.arch }}
path: dist/*
build-windows:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- target: x86_64-pc-windows-gnu
arch: x86_64
runner: ubuntu-24.04
- target: i686-pc-windows-gnu
arch: x86
runner: ubuntu-24.04
- target: aarch64-pc-windows-msvc
arch: arm64
runner: windows-11-arm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install mingw-w64 (x86_64/x86)
if: matrix.arch == 'x86_64' || matrix.arch == 'x86'
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 nasm
- name: Build binaries (Linux cross-compile)
if: matrix.arch != 'arm64'
run: |
cargo build --bins --workspace --release --target ${{ matrix.target }}
mkdir -p dist
cp target/${{ matrix.target }}/release/plumeimpactor.exe dist/Impactor-windows-${{ matrix.arch }}-portable.exe
cp target/${{ matrix.target }}/release/plumesign.exe dist/plumesign-windows-${{ matrix.arch }}.exe
- name: Build binaries (Windows ARM64 native)
if: matrix.arch == 'arm64'
shell: pwsh
run: |
cargo build --bins --workspace --release --target ${{ matrix.target }}
New-Item -ItemType Directory -Force -Path dist
Copy-Item "target/${{ matrix.target }}/release/plumeimpactor.exe" "dist/Impactor-windows-${{ matrix.arch }}-portable.exe"
Copy-Item "target/${{ matrix.target }}/release/plumesign.exe" "dist/plumesign-windows-${{ matrix.arch }}.exe"
- name: Upload Bundles
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-${{ matrix.arch }}
path: dist/*.exe
build-windows-installer:
runs-on: windows-latest
needs: [build-windows]
strategy:
matrix:
arch: [x86_64, x86, arm64]
steps:
- uses: actions/checkout@v4
- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-${{ matrix.arch }}
path: dist
- name: Install NSIS
run: choco install nsis.portable
- name: Build NSIS Installer
run: |
mkdir dist\nsis
copy package\windows\* dist\nsis\
copy dist\Impactor-windows-${{ matrix.arch }}-portable.exe dist\nsis\plumeimpactor.exe
makensis dist\nsis\installer.nsi
move dist\nsis\installer.exe dist\Impactor-windows-${{ matrix.arch }}-setup.exe
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-installer-${{ matrix.arch }}
path: dist/Impactor-windows-${{ matrix.arch }}-setup.exe
build-macos-slices:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- target: aarch64-apple-darwin
arch: arm
suffix: arm64
osxcross_prefix: arm64-apple-darwin21.4
- target: x86_64-apple-darwin
arch: intel
suffix: x86_64
osxcross_prefix: x86_64-apple-darwin21.4
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Setup osxcross
uses: Timmmm/setup-osxcross@v3
with:
osx-version: "12.3"
- name: Build binaries (${{ matrix.arch }})
run: |
target_env=$(echo "${{ matrix.target }}" | tr '-' '_')
target_env_upper=$(echo "${target_env}" | tr '[:lower:]' '[:upper:]')
prefix="${{ matrix.osxcross_prefix }}"
osxcross_bin="$(dirname "$(command -v "${prefix}-clang")")"
osxcross_root="$(cd "${osxcross_bin}/.." && pwd)"
sdk_dir="${osxcross_root}/SDK"
if [ -d "${sdk_dir}" ]; then
sdkroot="$(ls -d "${sdk_dir}"/MacOSX*.sdk 2>/dev/null | sort -V | tail -n1)"
if [ -n "${sdkroot}" ]; then
export SDKROOT="${sdkroot}"
fi
fi
export MACOSX_DEPLOYMENT_TARGET="11.0"
ld_path=""
for name in "${prefix}-ld" "${prefix}-ld64" "ld64" "ld"; do
if [ -x "${osxcross_bin}/${name}" ]; then
ld_path="${osxcross_bin}/${name}"
break
fi
done
export "CC_${target_env}=${osxcross_bin}/${prefix}-clang"
export "CXX_${target_env}=${osxcross_bin}/${prefix}-clang++"
export "AR_${target_env}=${osxcross_bin}/${prefix}-ar"
export "RANLIB_${target_env}=${osxcross_bin}/${prefix}-ranlib"
export "CARGO_TARGET_${target_env_upper}_LINKER=${osxcross_bin}/${prefix}-clang"
if [ -n "${ld_path}" ]; then
export "CFLAGS_${target_env}=-fuse-ld=${ld_path}"
export "CXXFLAGS_${target_env}=-fuse-ld=${ld_path}"
export "LDFLAGS_${target_env}=-fuse-ld=${ld_path}"
export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C link-arg=-fuse-ld=${ld_path}"
fi
cargo build --bins --workspace --release --target ${{ matrix.target }}
mkdir -p dist
cp target/${{ matrix.target }}/release/plumeimpactor dist/plumeimpactor-macos-${{ matrix.suffix }}
cp target/${{ matrix.target }}/release/plumesign dist/plumesign-macos-${{ matrix.suffix }}
- name: Upload ${{ matrix.arch }} Slice
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-slice-${{ matrix.arch }}
path: dist/*
build-macos-universal:
runs-on: macos-latest
needs: [build-macos-slices]
steps:
- uses: actions/checkout@v4
- name: Get ARM Slice
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-slice-arm
path: dist/slices
- name: Get Intel Slice
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-slice-intel
path: dist/slices
- name: Setup Certificates
uses: apple-actions/import-codesign-certs@v5
with:
p12-file-base64: ${{ secrets.DEV_ID_P12_BASE64 }}
p12-password: ${{ secrets.DEV_ID_P12_PASSWORD }}
- name: Download CreateDMG
run: |
brew install create-dmg
- name: Create Universal Binary
run: |
make macos BIN1=dist/slices/${{ env.BINARY_NAME }}-macos-arm64 BIN2=dist/slices/${{ env.BINARY_NAME }}-macos-x86_64 BUNDLE=1 ARCH=universal
make macos BIN1=dist/slices/${{ env.BINARY_NAME_CLI }}-macos-arm64 BIN2=dist/slices/${{ env.BINARY_NAME_CLI }}-macos-x86_64 ARCH=universal
- name: Codesign
run: |
mkdir -p dist/dmg
mv dist/${{ env.BUNDLE_NAME }}.app dist/dmg/
codesign --deep --force --options runtime \
--sign "${{ secrets.DEV_ID_IDENTITY_NAME }}" dist/dmg/${{ env.BUNDLE_NAME }}.app
- name: Create DMG
run: |
mkdir -p dist/out
create-dmg \
--volname ${{ env.BUNDLE_NAME }} \
--background "package/macos/background.png" \
--window-pos 200 120 \
--window-size 510 350 \
--icon-size 100 \
--icon ${{ env.BUNDLE_NAME }}.app 160 155 \
--hide-extension "${{ env.BUNDLE_NAME }}.app" \
--app-drop-link 350 155 \
dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg dist/dmg
- name: Notarize DMG
run: |
xcrun notarytool submit dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg --apple-id "${{ secrets.APPLE_ID_EMAIL }}" --password "${{ secrets.APPLE_ID_PASSWORD }}" --team-id "${{ secrets.APPLE_ID_TEAM }}" --wait
xcrun stapler staple dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg
- name: Upload Universal DMG
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-universal
path: |
dist/${{ env.BUNDLE_NAME }}-macos-universal.dmg
dist/${{ env.BINARY_NAME_CLI }}-macos-universal
release:
runs-on: ubuntu-24.04
needs: [build-linux, build-windows-installer, build-macos-universal]
steps:
- uses: actions/checkout@v4
- name: Download Linux x86_64 Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-linux-x86_64
path: prepare/
- name: Download Linux aarch64 Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-linux-aarch64
path: prepare/
- name: Download Windows x86_64 Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-x86_64
path: prepare/
- name: Download Windows x86_64 Installer Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-installer-x86_64
path: prepare/
- name: Download Windows arm64 Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-arm64
path: prepare/
- name: Download Windows arm64 Installer Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-installer-arm64
path: prepare/
- name: Download Windows x86 Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-x86
path: prepare/
- name: Download Windows x86 Installer Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-windows-installer-x86
path: prepare/
- name: Download MacOS Universal Artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-macos-universal
path: prepare/
- name: Prepare Uploads
run: |
mkdir -p upload
shopt -s globstar
mv prepare/**/*.dmg upload/
mv prepare/**/*.appimage upload/
mv prepare/**/*.exe upload/
mv prepare/**/plumesign* upload/
- name: Extract Version
id: get_version
run: |
VERSION=$(awk '/\[workspace.package\]/,/^$/' Cargo.toml | sed -nE 's/version *= *"([^"]*)".*/\1/p')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.get_version.outputs.version }}
tag_name: v${{ steps.get_version.outputs.version }}
files: |
upload/*
generate_release_notes: true
fail_on_unmatched_files: true
draft: true
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}