From fc5edbda16c877ab2063817983cf94ede158b1a0 Mon Sep 17 00:00:00 2001 From: Andreas Brenner Date: Wed, 24 Jun 2026 18:40:47 +0300 Subject: [PATCH] ANW-34 CI: gzip + strip release binaries ap keeps every release and the raw, unstripped binaries are the bulk of that storage. Strip symbols via the release profile and gzip -9 each asset before upload (~2.7x smaller); the publish job and Forgejo mirror-back pass the .gz assets through unchanged. Assumed .gz per binary over .tar.gz -- the assets are single files, so a tarball only adds a directory layer. Flag if a bundle (LICENSE/README) is wanted. E2E needs a release run; piggyback on the next real tag. --- .github/workflows/release.yml | 13 ++++++++----- Cargo.toml | 5 +++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9310ad..4c5c9c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,17 +85,20 @@ jobs: run: cargo build --release --locked # The runner is native to its target, so target/release/anwesen is the - # target binary. Name it so the target is unambiguous on the release. - - name: Name the asset for its target + # target binary (already stripped via the release profile). Name it so + # the target is unambiguous, then gzip it -- ap keeps every release and + # the raw binaries are the bulk of that, so assets ship compressed. + - name: Name and compress the asset for its target run: | - install -m 0755 target/release/anwesen \ - "anwesen-${{ github.event.inputs.tag || github.ref_name }}-${{ matrix.label }}" + asset="anwesen-${{ github.event.inputs.tag || github.ref_name }}-${{ matrix.label }}" + install -m 0755 target/release/anwesen "$asset" + gzip -9 "$asset" - name: Stash the binary for the publish job uses: actions/upload-artifact@v4 with: name: ${{ matrix.label }} - path: anwesen-*-${{ matrix.label }} + path: anwesen-*-${{ matrix.label }}.gz if-no-files-found: error publish: diff --git a/Cargo.toml b/Cargo.toml index 41e98a5..bce2367 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,11 @@ walkdir = "2" [dev-dependencies] tempfile = "3" +# Strip symbols from release binaries: smaller artifacts for the release +# pipeline (assets are also gzipped there) and for local release builds. +[profile.release] +strip = true + [lints.rust] unsafe_code = "forbid"