Skip to content

Linux + iPhone Continuity / iMessage / SMS

fix(packaging): release system built packages to fix API incompatibility

Zack Bartel0c3a630bea97
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..e653205
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,87 @@
+name: Release
+
+on:
+ push:
+ tags: ["v*"]
+
+permissions:
+ contents: write
+
+jobs:
+ package:
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ # debian bookworm is out of reach (gcc 12).
+ - image: ubuntu:24.04
+ generator: DEB
+ name: deb
+ - image: fedora:latest
+ generator: RPM
+ name: rpm
+ - image: archlinux:base-devel
+ generator: TGZ
+ name: tgz
+ runs-on: ubuntu-latest
+ container: ${{ matrix.image }}
+ steps:
+ - name: bootstrap git
+ run: |
+ . /etc/os-release
+ case ${ID_LIKE:-$ID} in
+ *arch*) pacman -Sy --noconfirm --needed git ;;
+ *fedora*) dnf install -y git ;;
+ *debian*|*ubuntu*) apt-get update && apt-get install -y --no-install-recommends git ca-certificates ;;
+ esac
+
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
+
+ - name: dependencies
+ run: ./scripts/ci-deps.sh
+
+ - name: build
+ run: |
+ cmake --preset release
+ cmake --build --preset release
+
+ - name: unit tests
+ run: ctest --test-dir build/release --output-on-failure
+
+ - name: package
+ run: cd build/release && cpack -G ${{ matrix.generator }}
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: ${{ matrix.name }}
+ path: |
+ build/release/*.deb
+ build/release/*.rpm
+ build/release/*.tar.gz
+ if-no-files-found: error
+
+ release:
+ needs: package
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/download-artifact@v4
+ with:
+ path: dist
+ merge-multiple: true
+
+ - name: publish
+ env:
+ GH_TOKEN: ${{ github.token }}
+ TAG: ${{ github.ref_name }}
+ run: |
+ ls -l dist
+ if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ gh release upload "$TAG" dist/* --repo "$GITHUB_REPOSITORY" --clobber
+ else
+ gh release create "$TAG" dist/* --repo "$GITHUB_REPOSITORY" \
+ --title "Release $TAG" --generate-notes
+ fi
diff --git a/scripts/ci-deps.sh b/scripts/ci-deps.sh
index beac020..719ba33 100755
--- a/scripts/ci-deps.sh
+++ b/scripts/ci-deps.sh
@@ -22,7 +22,7 @@ case ${ID_LIKE:-$ID} in
gcc-c++ cmake ninja-build git pkgconf-pkg-config \
wayland-devel avahi-devel openssl-devel glib2-devel \
gtk3-devel gtk-layer-shell-devel libnotify-devel \
- npm zip
+ npm zip rpm-build
;;
*debian*|*ubuntu*)
export DEBIAN_FRONTEND=noninteractive
diff --git a/scripts/release.sh b/scripts/release.sh
index 216305d..dc639bd 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -52,20 +52,28 @@ fi
git push origin main
git push origin "$TAG"
-# 4. Build Packages
-echo "πŸ“¦ Building packages..."
-rm -rf "$REPO_ROOT/build/release"
-make package
+# 4. Wait for CI to build and publish the packages
+# Packages are built by .github/workflows/release.yml, each in the distro it targets:
+# a .deb linked against Arch's glibc and libstdc++ will not start on Debian or Ubuntu.
+echo "πŸ“¦ Waiting for the release workflow..."
+RUN_ID=""
+for _ in $(seq 30); do
+ RUN_ID=$(gh run list --workflow=release.yml --branch "$TAG" --limit 1 --json databaseId --jq '.[0].databaseId')
+ [ -n "$RUN_ID" ] && break
+ sleep 5
+done
+if [ -z "$RUN_ID" ]; then
+ echo "Error: no release workflow run found for $TAG."
+ exit 1
+fi
+gh run watch "$RUN_ID" --exit-status
-# 5. Create GitHub Release
-echo "🌐 Creating GitHub Release..."
+# 5. Fetch the published tarball, which tether-bin needs the checksum of
ASSET_DIR="$REPO_ROOT/build/release"
-# Find the specific tarball, deb, and rpm
+mkdir -p "$ASSET_DIR"
TARBALL="$ASSET_DIR/tether-$VERSION.tar.gz"
-DEB=$(ls "$ASSET_DIR"/tether-*.deb | head -n 1)
-RPM=$(ls "$ASSET_DIR"/tether-*.rpm | head -n 1)
-
-gh release create "$TAG" "$TARBALL" "$DEB" "$RPM" --title "Release $TAG" --generate-notes
+rm -f "$TARBALL"
+gh release download "$TAG" --pattern "tether-$VERSION.tar.gz" --dir "$ASSET_DIR"
# 6. Update AUR (tether-git)
if [ -d "$AUR_GIT_DIR" ]; then