this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ci: validate aarch64 in nix.yml and attach static binaries to releases

nix.yml: split the existing build job into lint (x86_64 only — fmt,
treefmt, deny, clippy, doc) and build (matrix over x86_64 and aarch64
— test, cmprss, cmprss-static, flake check). Architecture-independent
checks no longer run twice.

publish.yml: add a binaries job that builds cmprss-static via the flake
on x86_64 and aarch64 runners and attaches the resulting tarballs (with
SHA256 sidecars) to the GitHub Release. Runs only on release/dispatch
events — every-push validation is now covered by nix.yml.

+99 -4
+22 -1
.github/workflows/nix.yml
··· 7 7 branches: ["main"] 8 8 9 9 jobs: 10 - build: 10 + # Architecture-independent lints and formatting. Run once on x86_64. 11 + lint: 11 12 runs-on: ubuntu-latest 12 13 steps: 13 14 - name: Checkout ··· 31 32 32 33 - name: Build docs 33 34 run: nix build .#doc 35 + 36 + # Build and test on each supported architecture. 37 + build: 38 + name: Build (${{ matrix.arch }}) 39 + runs-on: ${{ matrix.runner }} 40 + strategy: 41 + fail-fast: false 42 + matrix: 43 + include: 44 + - runner: ubuntu-latest 45 + arch: x86_64 46 + - runner: ubuntu-24.04-arm 47 + arch: aarch64 48 + steps: 49 + - name: Checkout 50 + uses: actions/checkout@v4 51 + - name: Install Nix 52 + uses: DeterminateSystems/nix-installer-action@v12 53 + - name: Nix Cache 54 + uses: DeterminateSystems/magic-nix-cache-action@v7 34 55 35 56 - name: Test 36 57 run: nix build .#test
+77 -3
.github/workflows/publish.yml
··· 1 - # Publish workflow — builds snap package and publishes to the Snap Store. 1 + # Publish workflow — publishes release artifacts. 2 + # 3 + # Jobs: 4 + # - snap: builds and publishes the snap package to the Snap Store. 5 + # - binaries: builds static musl binaries via Nix and attaches them to the 6 + # GitHub Release. Runs only on release events (not on push validation). 2 7 # 3 8 # Triggers: 4 9 # 1. workflow_run: After Nix CI passes on main. Builds the snap to validate 5 - # the packaging pipeline on every push to main. 10 + # the packaging pipeline on every push to main. The binaries job is 11 + # skipped on this trigger. 6 12 # 7 13 # 2. workflow_dispatch: Triggered by the release-plz workflow after a release 8 14 # is created, or manually for retrying a failed release. Accepts a tag name 9 - # input and publishes the snap for that tag. 15 + # input and publishes the snap and uploads binaries for that tag. 10 16 # 11 17 # 3. release (published): Kept as a fallback trigger in case the release is 12 18 # created with a token that fires events (e.g. a PAT or GitHub App token). ··· 84 90 with: 85 91 snap: ${{ steps.build.outputs.snap }} 86 92 release: stable 93 + 94 + binaries: 95 + name: Binary (${{ matrix.target }}) 96 + runs-on: ${{ matrix.runner }} 97 + if: | 98 + github.repository_owner == 'arcuru' && 99 + (github.event_name == 'release' || github.event_name == 'workflow_dispatch') 100 + permissions: 101 + contents: write 102 + strategy: 103 + fail-fast: false 104 + matrix: 105 + include: 106 + - runner: ubuntu-latest 107 + target: x86_64-unknown-linux-musl 108 + - runner: ubuntu-24.04-arm 109 + target: aarch64-unknown-linux-musl 110 + steps: 111 + - name: Resolve tag 112 + id: tag 113 + env: 114 + EVENT_NAME: ${{ github.event_name }} 115 + RELEASE_TAG: ${{ github.event.release.tag_name }} 116 + INPUT_TAG: ${{ inputs.tag_name }} 117 + run: | 118 + if [[ "$EVENT_NAME" == "release" ]]; then 119 + TAG="$RELEASE_TAG" 120 + else 121 + TAG="$INPUT_TAG" 122 + fi 123 + echo "tag=$TAG" >> "$GITHUB_OUTPUT" 124 + 125 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 126 + with: 127 + ref: ${{ steps.tag.outputs.tag }} 128 + 129 + - name: Install Nix 130 + uses: DeterminateSystems/nix-installer-action@v12 131 + 132 + - name: Nix Cache 133 + uses: DeterminateSystems/magic-nix-cache-action@v7 134 + 135 + - name: Build static binary 136 + run: nix build -L .#cmprss-static 137 + 138 + - name: Package binary 139 + id: pkg 140 + env: 141 + TAG: ${{ steps.tag.outputs.tag }} 142 + TARGET: ${{ matrix.target }} 143 + run: | 144 + DIR="cmprss-${TAG}-${TARGET}" 145 + ASSET="${DIR}.tar.gz" 146 + mkdir "$DIR" 147 + install -m 0755 result/bin/cmprss "${DIR}/cmprss" 148 + cp README.md LICENSE.txt "${DIR}/" 149 + tar -czf "$ASSET" "$DIR" 150 + sha256sum "$ASSET" > "${ASSET}.sha256" 151 + echo "asset=$ASSET" >> "$GITHUB_OUTPUT" 152 + 153 + - name: Upload to GitHub Release 154 + env: 155 + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 156 + TAG: ${{ steps.tag.outputs.tag }} 157 + ASSET: ${{ steps.pkg.outputs.asset }} 158 + run: | 159 + gh release upload "$TAG" "$ASSET" "${ASSET}.sha256" \ 160 + --clobber --repo "$GITHUB_REPOSITORY"