-
Notifications
You must be signed in to change notification settings - Fork 9
619 lines (534 loc) · 22 KB
/
release.yml
File metadata and controls
619 lines (534 loc) · 22 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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v0.11.3)'
required: true
type: string
env:
# Use input tag for workflow_dispatch, or ref_name for push events
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
is_prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Check if prerelease
id: check_prerelease
run: |
if [[ "${{ env.RELEASE_TAG }}" =~ -(alpha|beta|rc)\. ]]; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
echo "Detected prerelease tag: ${{ env.RELEASE_TAG }}"
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
echo "Detected stable release tag: ${{ env.RELEASE_TAG }}"
fi
- name: Create or Update Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
body_path: RELEASE_NOTES.md
draft: false
prerelease: ${{ steps.check_prerelease.outputs.is_prerelease == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
name: Build macOS (${{ matrix.arch }})
needs: create-release
runs-on: macos-latest
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64
target: aarch64-apple-darwin
- arch: x86_64
target: x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: apps/fluux/src-tauri
key: ${{ matrix.target }}
- name: Install dependencies
run: npm ci
- name: Build SDK
run: npm run build:sdk
- name: Read release notes
id: release_notes
run: |
if [ -f RELEASE_NOTES.md ]; then
NOTES=$(cat RELEASE_NOTES.md)
else
NOTES="See the [CHANGELOG](https://github.com/processone/fluux-messenger/blob/main/CHANGELOG.md) for details."
fi
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Patch version for Tauri semver compatibility
run: |
# Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
# Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
# For stable versions (no hyphen), this is a no-op
VERSION="${RELEASE_TAG#v}"
if [[ "$VERSION" == *-* ]]; then
BASE_VERSION="${VERSION%%-*}"
echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
sed -i '' "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
sed -i '' "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
else
echo "Stable version $VERSION — no patching needed"
fi
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
projectPath: apps/fluux
tagName: ${{ env.RELEASE_TAG }}
releaseName: 'Fluux Messenger ${{ env.RELEASE_TAG }}'
releaseBody: ${{ steps.release_notes.outputs.notes }}
releaseDraft: false
prerelease: ${{ needs.create-release.outputs.is_prerelease == 'true' }}
includeUpdaterJson: false
args: --target ${{ matrix.target }}
build-windows:
name: Build Windows
needs: create-release
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: apps/fluux/src-tauri
- name: Install dependencies
run: npm ci
- name: Build SDK
run: npm run build:sdk
- name: Read release notes
id: release_notes
shell: bash
run: |
if [ -f RELEASE_NOTES.md ]; then
NOTES=$(cat RELEASE_NOTES.md)
else
NOTES="See the [CHANGELOG](https://github.com/processone/fluux-messenger/blob/main/CHANGELOG.md) for details."
fi
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Patch version for Tauri semver compatibility
shell: bash
run: |
# Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
# Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
# For stable versions (no hyphen), this is a no-op
VERSION="${RELEASE_TAG#v}"
if [[ "$VERSION" == *-* ]]; then
BASE_VERSION="${VERSION%%-*}"
echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
else
echo "Stable version $VERSION — no patching needed"
fi
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
projectPath: apps/fluux
tagName: ${{ env.RELEASE_TAG }}
releaseName: 'Fluux Messenger ${{ env.RELEASE_TAG }}'
releaseBody: ${{ steps.release_notes.outputs.notes }}
releaseDraft: false
prerelease: ${{ needs.create-release.outputs.is_prerelease == 'true' }}
includeUpdaterJson: false # Generated by rename-assets script with all platforms
- name: Sign Windows executables with Azure Trusted Signing
uses: azure/trusted-signing-action@v0.5.1
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: ${{ secrets.AZURE_SIGNING_ENDPOINT }}
trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_ACCOUNT }}
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
files-folder: apps/fluux/src-tauri/target/release/bundle
files-folder-filter: exe,msi
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Re-sign Authenticode-signed binaries for Tauri updater
shell: bash
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
# After Azure Trusted Signing modifies the binaries (embeds Authenticode signature),
# the original .sig files are stale. Re-generate them against the signed binaries.
# Note: tauri signer CLI reads TAURI_PRIVATE_KEY (not TAURI_SIGNING_PRIVATE_KEY),
# while tauri-action handles the mapping internally.
npx tauri signer sign apps/fluux/src-tauri/target/release/bundle/nsis/*.exe
npx tauri signer sign apps/fluux/src-tauri/target/release/bundle/msi/*.msi
- name: Re-upload signed artifacts
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ env.RELEASE_TAG }} apps/fluux/src-tauri/target/release/bundle/nsis/*.exe --clobber
gh release upload ${{ env.RELEASE_TAG }} apps/fluux/src-tauri/target/release/bundle/nsis/*.exe.sig --clobber
gh release upload ${{ env.RELEASE_TAG }} apps/fluux/src-tauri/target/release/bundle/msi/*.msi --clobber
gh release upload ${{ env.RELEASE_TAG }} apps/fluux/src-tauri/target/release/bundle/msi/*.msi.sig --clobber
build-linux:
name: Build Linux (${{ matrix.arch }})
needs: create-release
runs-on: ${{ matrix.runner }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-22.04
target: x86_64-unknown-linux-gnu
deb_arch: amd64
- arch: aarch64
runner: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
deb_arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libxss-dev \
devscripts \
debhelper
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: apps/fluux/src-tauri
key: ${{ matrix.target }}
- name: Install dependencies
run: npm ci
- name: Build SDK
run: npm run build:sdk
- name: Read release notes
id: release_notes
run: |
if [ -f RELEASE_NOTES.md ]; then
NOTES=$(cat RELEASE_NOTES.md)
else
NOTES="See the [CHANGELOG](https://github.com/processone/fluux-messenger/blob/main/CHANGELOG.md) for details."
fi
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Patch version for Tauri semver compatibility
run: |
# Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
# Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
# For stable versions (no hyphen), this is a no-op
VERSION="${RELEASE_TAG#v}"
if [[ "$VERSION" == *-* ]]; then
BASE_VERSION="${VERSION%%-*}"
echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
else
echo "Stable version $VERSION — no patching needed"
fi
- name: Build Tauri binary
run: |
cd apps/fluux
# Native build on matching runner (x86 on ubuntu-22.04, arm on ubuntu-22.04-arm)
npm run tauri build -- --no-bundle
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Create tarball for Arch Linux
run: |
VERSION="${RELEASE_TAG#v}"
ARCH="${{ matrix.arch }}"
TARBALL_NAME="fluux-messenger-${VERSION}-linux-${ARCH}.tar.gz"
mkdir -p tarball-staging/fluux-messenger
# Copy binary
cp apps/fluux/src-tauri/target/release/fluux tarball-staging/fluux-messenger/fluux-messenger
# Copy desktop file and icons
cp packaging/debian/fluux-messenger.desktop tarball-staging/fluux-messenger/
cp apps/fluux/src-tauri/icons/128x128.png tarball-staging/fluux-messenger/fluux-messenger.png
cp apps/fluux/src-tauri/icons/256x256.png tarball-staging/fluux-messenger/fluux-messenger-256.png
# Create tarball
mkdir -p dist
tar -czvf "dist/${TARBALL_NAME}" -C tarball-staging fluux-messenger
- name: Upload tarball to Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.tar.gz
tag_name: ${{ env.RELEASE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build .deb package
run: |
# Copy debian directory from packaging/ to root (required by dpkg-buildpackage)
cp -r packaging/debian .
# Point to pre-built binary (debian/rules will skip build)
# Native builds output to target/release/, not target/<triple>/release/
export FLUUX_BINARY="apps/fluux/src-tauri/target/release/fluux"
# Update debian/changelog version from release tag
# Convert pre-release for Debian (~ sorts before release, so 0.13.2~beta.1 < 0.13.2)
# Note: cannot use ${VERSION//-/~} because bash 5+ applies tilde expansion
# to the replacement string, turning ~ into $HOME
VERSION="${RELEASE_TAG#v}"
DEB_VERSION=$(echo "$VERSION" | sed 's/-/~/g')
sed -i "1s#([^)]*)#($DEB_VERSION-1)#" debian/changelog
# Build the .deb package (-d skips build dependency check since we use pre-built binary)
dpkg-buildpackage -d -uc -us -b
# Move .deb to a known location (dpkg already includes architecture in filename)
mkdir -p dist
mv ../fluux-messenger_*.deb dist/
- name: Upload .deb to Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.deb
tag_name: ${{ env.RELEASE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Flatpak
run: |
# Install flatpak-builder
sudo apt-get install -y flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.gnome.Platform//47 org.gnome.Sdk//47
VERSION="${RELEASE_TAG#v}"
ARCH="${{ matrix.arch }}"
# Prepare build directory with sources
mkdir -p flatpak-build
cp apps/fluux/src-tauri/target/release/fluux flatpak-build/fluux-messenger
cp packaging/debian/fluux-messenger.desktop flatpak-build/
cp apps/fluux/src-tauri/icons/128x128.png flatpak-build/fluux-messenger.png
cp apps/fluux/src-tauri/icons/256x256.png flatpak-build/fluux-messenger-256.png
cp packaging/flatpak/com.processone.fluux.metainfo.xml flatpak-build/
cp packaging/flatpak/com.processone.fluux.yaml flatpak-build/
# Build Flatpak
cd flatpak-build
flatpak-builder --user --force-clean --disable-updates --repo=repo build-dir com.processone.fluux.yaml
# Create single-file bundle
flatpak build-bundle repo "fluux-messenger-${VERSION}-linux-${ARCH}.flatpak" com.processone.fluux
# Move to dist
mv *.flatpak ../dist/
- name: Upload Flatpak to Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.flatpak
tag_name: ${{ env.RELEASE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux-rpm:
name: Build Linux RPM (${{ matrix.arch }})
needs: create-release
runs-on: ${{ matrix.runner }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-22.04
target: x86_64-unknown-linux-gnu
rpm_arch: x86_64
- arch: aarch64
runner: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
rpm_arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libxss-dev \
rpm
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: apps/fluux/src-tauri
key: ${{ matrix.target }}
- name: Install dependencies
run: npm ci
- name: Build SDK
run: npm run build:sdk
- name: Patch version for Tauri semver compatibility
run: |
# Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
# Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
# For stable versions (no hyphen), this is a no-op
VERSION="${RELEASE_TAG#v}"
if [[ "$VERSION" == *-* ]]; then
BASE_VERSION="${VERSION%%-*}"
echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
else
echo "Stable version $VERSION — no patching needed"
fi
- name: Build Tauri binary
run: |
cd apps/fluux
npm run tauri build -- --no-bundle
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Build .rpm package
run: |
VERSION="${RELEASE_TAG#v}"
# Convert pre-release version for RPM (hyphens not allowed in Version field)
# 0.13.2-beta.1 → RPM_VERSION=0.13.2, RPM_RELEASE=0.1.beta.1
# 0.13.2 → RPM_VERSION=0.13.2, RPM_RELEASE=1
if [[ "$VERSION" == *-* ]]; then
RPM_VERSION="${VERSION%%-*}"
RPM_PRERELEASE="${VERSION#*-}"
RPM_RELEASE="0.1.${RPM_PRERELEASE//-/.}"
else
RPM_VERSION="$VERSION"
RPM_RELEASE="1"
fi
# Setup RPM build directories
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# Create source tarball for rpmbuild (directory name must match %{version} in spec)
mkdir -p "fluux-messenger-${RPM_VERSION}"
cp apps/fluux/src-tauri/target/release/fluux "fluux-messenger-${RPM_VERSION}/fluux-messenger"
cp packaging/debian/fluux-messenger.desktop "fluux-messenger-${RPM_VERSION}/"
mkdir -p "fluux-messenger-${RPM_VERSION}/icons"
cp apps/fluux/src-tauri/icons/32x32.png "fluux-messenger-${RPM_VERSION}/icons/"
cp apps/fluux/src-tauri/icons/64x64.png "fluux-messenger-${RPM_VERSION}/icons/"
cp apps/fluux/src-tauri/icons/128x128.png "fluux-messenger-${RPM_VERSION}/icons/"
cp apps/fluux/src-tauri/icons/256x256.png "fluux-messenger-${RPM_VERSION}/icons/"
tar czvf ~/rpmbuild/SOURCES/fluux-messenger-${RPM_VERSION}.tar.gz "fluux-messenger-${RPM_VERSION}"
# Copy and update spec file
cp packaging/rpm/fluux-messenger.spec ~/rpmbuild/SPECS/
sed -i "s/^Version:.*/Version: ${RPM_VERSION}/" ~/rpmbuild/SPECS/fluux-messenger.spec
sed -i "s/^Release:.*/Release: ${RPM_RELEASE}%{?dist}/" ~/rpmbuild/SPECS/fluux-messenger.spec
# Build RPM
rpmbuild -bb ~/rpmbuild/SPECS/fluux-messenger.spec --target ${{ matrix.rpm_arch }}
# Move RPM to dist
mkdir -p dist
mv ~/rpmbuild/RPMS/${{ matrix.rpm_arch }}/*.rpm dist/
- name: Upload .rpm to Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.rpm
tag_name: ${{ env.RELEASE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Final job to rename all assets to consistent, user-friendly names
rename-assets:
name: Rename Release Assets
runs-on: ubuntu-latest
needs: [create-release, build-macos, build-windows, build-linux, build-linux-rpm]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Rename assets and update latest.json
run: |
ARGS="${{ env.RELEASE_TAG }}"
if [ "${{ needs.create-release.outputs.is_prerelease }}" = "true" ]; then
ARGS="$ARGS --skip-updater"
fi
node scripts/rename-release-assets.js $ARGS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}