@@ -108,6 +108,21 @@ jobs:
108108 echo "$NOTES" >> $GITHUB_OUTPUT
109109 echo "EOF" >> $GITHUB_OUTPUT
110110
111+ - name : Patch version for Tauri semver compatibility
112+ run : |
113+ # Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
114+ # Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
115+ # For stable versions (no hyphen), this is a no-op
116+ VERSION="${RELEASE_TAG#v}"
117+ if [[ "$VERSION" == *-* ]]; then
118+ BASE_VERSION="${VERSION%%-*}"
119+ echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
120+ sed -i '' "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
121+ sed -i '' "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
122+ else
123+ echo "Stable version $VERSION — no patching needed"
124+ fi
125+
111126 - name : Build Tauri app
112127 uses : tauri-apps/tauri-action@v0
113128 env :
@@ -176,6 +191,22 @@ jobs:
176191 echo "$NOTES" >> $GITHUB_OUTPUT
177192 echo "EOF" >> $GITHUB_OUTPUT
178193
194+ - name : Patch version for Tauri semver compatibility
195+ shell : bash
196+ run : |
197+ # Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
198+ # Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
199+ # For stable versions (no hyphen), this is a no-op
200+ VERSION="${RELEASE_TAG#v}"
201+ if [[ "$VERSION" == *-* ]]; then
202+ BASE_VERSION="${VERSION%%-*}"
203+ echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
204+ sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
205+ sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
206+ else
207+ echo "Stable version $VERSION — no patching needed"
208+ fi
209+
179210 - name : Build Tauri app
180211 uses : tauri-apps/tauri-action@v0
181212 env :
@@ -255,6 +286,7 @@ jobs:
255286 uses : actions/checkout@v4
256287 with :
257288 ref : ${{ env.RELEASE_TAG }}
289+ submodules : true
258290
259291 - name : Install Linux dependencies
260292 run : |
@@ -303,6 +335,21 @@ jobs:
303335 echo "$NOTES" >> $GITHUB_OUTPUT
304336 echo "EOF" >> $GITHUB_OUTPUT
305337
338+ - name : Patch version for Tauri semver compatibility
339+ run : |
340+ # Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
341+ # Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
342+ # For stable versions (no hyphen), this is a no-op
343+ VERSION="${RELEASE_TAG#v}"
344+ if [[ "$VERSION" == *-* ]]; then
345+ BASE_VERSION="${VERSION%%-*}"
346+ echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
347+ sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
348+ sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
349+ else
350+ echo "Stable version $VERSION — no patching needed"
351+ fi
352+
306353 - name : Build Tauri binary
307354 run : |
308355 cd apps/fluux
@@ -326,7 +373,7 @@ jobs:
326373 # Copy desktop file and icons
327374 cp packaging/debian/fluux-messenger.desktop tarball-staging/fluux-messenger/
328375 cp apps/fluux/src-tauri/icons/128x128.png tarball-staging/fluux-messenger/fluux-messenger.png
329- cp apps/fluux/src-tauri/icons/icon .png tarball-staging/fluux-messenger/fluux-messenger-256.png
376+ cp apps/fluux/src-tauri/icons/256x256 .png tarball-staging/fluux-messenger/fluux-messenger-256.png
330377
331378 # Create tarball
332379 mkdir -p dist
@@ -350,8 +397,12 @@ jobs:
350397 export FLUUX_BINARY="apps/fluux/src-tauri/target/release/fluux"
351398
352399 # Update debian/changelog version from release tag
400+ # Convert pre-release for Debian (~ sorts before release, so 0.13.2~beta.1 < 0.13.2)
401+ # Note: cannot use ${VERSION//-/~} because bash 5+ applies tilde expansion
402+ # to the replacement string, turning ~ into $HOME
353403 VERSION="${RELEASE_TAG#v}"
354- sed -i "1s/([^)]*)/($VERSION-1)/" debian/changelog
404+ DEB_VERSION=$(echo "$VERSION" | sed 's/-/~/g')
405+ sed -i "1s#([^)]*)#($DEB_VERSION-1)#" debian/changelog
355406
356407 # Build the .deb package (-d skips build dependency check since we use pre-built binary)
357408 dpkg-buildpackage -d -uc -us -b
@@ -383,9 +434,10 @@ jobs:
383434 cp apps/fluux/src-tauri/target/release/fluux flatpak-build/fluux-messenger
384435 cp packaging/debian/fluux-messenger.desktop flatpak-build/
385436 cp apps/fluux/src-tauri/icons/128x128.png flatpak-build/fluux-messenger.png
386- cp apps/fluux/src-tauri/icons/icon .png flatpak-build/fluux-messenger-256.png
437+ cp apps/fluux/src-tauri/icons/256x256 .png flatpak-build/fluux-messenger-256.png
387438 cp packaging/flatpak/com.processone.fluux.metainfo.xml flatpak-build/
388439 cp packaging/flatpak/com.processone.fluux.yaml flatpak-build/
440+ cp -r packaging/flatpak/shared-modules flatpak-build/
389441
390442 # Build Flatpak
391443 cd flatpak-build
@@ -465,6 +517,21 @@ jobs:
465517 - name : Build SDK
466518 run : npm run build:sdk
467519
520+ - name : Patch version for Tauri semver compatibility
521+ run : |
522+ # Tauri v2 requires strict semver (X.Y.Z) — prerelease suffixes are rejected
523+ # Strip prerelease suffix: 0.13.2-beta.1 → 0.13.2
524+ # For stable versions (no hyphen), this is a no-op
525+ VERSION="${RELEASE_TAG#v}"
526+ if [[ "$VERSION" == *-* ]]; then
527+ BASE_VERSION="${VERSION%%-*}"
528+ echo "Patching version for Tauri build: $VERSION → $BASE_VERSION"
529+ sed -i "s|\"version\": \".*\"|\"version\": \"$BASE_VERSION\"|" apps/fluux/src-tauri/tauri.conf.json
530+ sed -i "s|^version = \".*\"|version = \"$BASE_VERSION\"|" apps/fluux/src-tauri/Cargo.toml
531+ else
532+ echo "Stable version $VERSION — no patching needed"
533+ fi
534+
468535 - name : Build Tauri binary
469536 run : |
470537 cd apps/fluux
@@ -477,23 +544,37 @@ jobs:
477544 run : |
478545 VERSION="${RELEASE_TAG#v}"
479546
547+ # Convert pre-release version for RPM (hyphens not allowed in Version field)
548+ # 0.13.2-beta.1 → RPM_VERSION=0.13.2, RPM_RELEASE=0.1.beta.1
549+ # 0.13.2 → RPM_VERSION=0.13.2, RPM_RELEASE=1
550+ if [[ "$VERSION" == *-* ]]; then
551+ RPM_VERSION="${VERSION%%-*}"
552+ RPM_PRERELEASE="${VERSION#*-}"
553+ RPM_RELEASE="0.1.${RPM_PRERELEASE//-/.}"
554+ else
555+ RPM_VERSION="$VERSION"
556+ RPM_RELEASE="1"
557+ fi
558+
480559 # Setup RPM build directories
481560 mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
482561
483- # Create source tarball for rpmbuild
484- mkdir -p "fluux-messenger-${VERSION}"
485- cp apps/fluux/src-tauri/target/release/fluux "fluux-messenger-${VERSION}/fluux-messenger"
486- cp packaging/debian/fluux-messenger.desktop "fluux-messenger-${VERSION}/"
487- mkdir -p "fluux-messenger-${VERSION}/icons"
488- cp apps/fluux/src-tauri/icons/32x32.png "fluux-messenger-${VERSION}/icons/"
489- cp apps/fluux/src-tauri/icons/128x128.png "fluux-messenger-${VERSION}/icons/"
490- cp apps/fluux/src-tauri/icons/icon.png "fluux-messenger-${VERSION}/icons/256x256.png"
562+ # Create source tarball for rpmbuild (directory name must match %{version} in spec)
563+ mkdir -p "fluux-messenger-${RPM_VERSION}"
564+ cp apps/fluux/src-tauri/target/release/fluux "fluux-messenger-${RPM_VERSION}/fluux-messenger"
565+ cp packaging/debian/fluux-messenger.desktop "fluux-messenger-${RPM_VERSION}/"
566+ mkdir -p "fluux-messenger-${RPM_VERSION}/icons"
567+ cp apps/fluux/src-tauri/icons/32x32.png "fluux-messenger-${RPM_VERSION}/icons/"
568+ cp apps/fluux/src-tauri/icons/64x64.png "fluux-messenger-${RPM_VERSION}/icons/"
569+ cp apps/fluux/src-tauri/icons/128x128.png "fluux-messenger-${RPM_VERSION}/icons/"
570+ cp apps/fluux/src-tauri/icons/256x256.png "fluux-messenger-${RPM_VERSION}/icons/"
491571
492- tar czvf ~/rpmbuild/SOURCES/fluux-messenger-${VERSION }.tar.gz "fluux-messenger-${VERSION }"
572+ tar czvf ~/rpmbuild/SOURCES/fluux-messenger-${RPM_VERSION }.tar.gz "fluux-messenger-${RPM_VERSION }"
493573
494574 # Copy and update spec file
495575 cp packaging/rpm/fluux-messenger.spec ~/rpmbuild/SPECS/
496- sed -i "s/^Version:.*/Version: ${VERSION}/" ~/rpmbuild/SPECS/fluux-messenger.spec
576+ sed -i "s/^Version:.*/Version: ${RPM_VERSION}/" ~/rpmbuild/SPECS/fluux-messenger.spec
577+ sed -i "s/^Release:.*/Release: ${RPM_RELEASE}%{?dist}/" ~/rpmbuild/SPECS/fluux-messenger.spec
497578
498579 # Build RPM
499580 rpmbuild -bb ~/rpmbuild/SPECS/fluux-messenger.spec --target ${{ matrix.rpm_arch }}
0 commit comments