diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff90820..b346046 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -153,9 +153,39 @@ jobs: name: sbom path: "**/*.cdx.json" + appimage: + name: appimage (anylinux-${{ matrix.arch }}) + needs: [lint, test, security, golden-cross-platform, bench-regression, fidelity-smoke] + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + runs-on: ubuntu-latest + - arch: aarch64 + runs-on: ubuntu-26.04-arm + runs-on: ${{ matrix.runs-on }} + container: ghcr.io/pkgforge-dev/archlinux:latest + steps: + - uses: actions/checkout@v6 + - name: Preparing container + uses: pkgforge-dev/anylinux-setup-action@b2d1ce4216f71162e00ae58fa11ee9aeb723d0d5 # v5 + - name: Make AppImage + run: /bin/sh ./scripts/make-appimage.sh + - name: Checksum AppImage + run: | + cd dist + for f in *.AppImage; do + sha256sum "$f" > "$f.sha256" + done + - uses: actions/upload-artifact@v7 + with: + name: tokenfold-anylinux-${{ matrix.arch }} + path: dist/*.AppImage* + publish-github-release: name: publish-github-release - needs: [cross-compile, sbom, sdk-artifacts] + needs: [cross-compile, sbom, sdk-artifacts, appimage] runs-on: ubuntu-latest permissions: contents: write diff --git a/scripts/make-appimage.sh b/scripts/make-appimage.sh new file mode 100644 index 0000000..741d0c8 --- /dev/null +++ b/scripts/make-appimage.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -eux + +ARCH="$(uname -m)" +VERSION="${VERSION:-$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -1)}" + +export ARCH VERSION +export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" +export OUTPATH="$PWD/dist" +export OUTNAME=tokenfold-"$VERSION"-anylinux-"$ARCH".AppImage +export ICON="DUMMY" +export DESKTOP="DUMMY" +export MAIN_BIN="/usr/bin/tokenfold" + +pacman -Syu --noconfirm --needed rustup git +rustup toolchain install 1.98 --profile minimal + +cargo build --release --locked -p tokenfold-cli +install -Dm755 target/release/tokenfold /usr/bin/tokenfold + +quick-sharun $MAIN_BIN +quick-sharun --make-appimage +quick-sharun --simple-test ./dist/*.AppImage