From 61620f679c17689b23ad333361214d7f8d6a0e32 Mon Sep 17 00:00:00 2001 From: Thomas Nemer Date: Sat, 21 Feb 2026 13:29:53 +0100 Subject: [PATCH] Split release workflow into per-target workflows with individual badges GitHub Actions badges only work at the workflow level, not per-job. To show per-platform build status, split the monolithic release.yml into 5 separate workflows (one per build target). Each workflow builds its target and uploads directly to the GitHub release. --- .github/workflows/release-linux-aarch64.yml | 55 ++++++++ .github/workflows/release-linux-x86_64.yml | 50 +++++++ .github/workflows/release-macos-aarch64.yml | 50 +++++++ .github/workflows/release-macos-x86_64.yml | 50 +++++++ .github/workflows/release-windows-x86_64.yml | 45 ++++++ .github/workflows/release.yml | 137 ------------------- README.md | 6 +- 7 files changed, 255 insertions(+), 138 deletions(-) create mode 100644 .github/workflows/release-linux-aarch64.yml create mode 100644 .github/workflows/release-linux-x86_64.yml create mode 100644 .github/workflows/release-macos-aarch64.yml create mode 100644 .github/workflows/release-macos-x86_64.yml create mode 100644 .github/workflows/release-windows-x86_64.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-linux-aarch64.yml b/.github/workflows/release-linux-aarch64.yml new file mode 100644 index 0000000..913c228 --- /dev/null +++ b/.github/workflows/release-linux-aarch64.yml @@ -0,0 +1,55 @@ +name: Release Linux aarch64 + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: jdx/mise-action@v2 + + - name: Add target + run: rustup target add aarch64-unknown-linux-gnu + + - name: Install cross + run: cargo install cross --git https://github.com/cross-rs/cross + + - name: Build + run: cross build --release --target aarch64-unknown-linux-gnu + + - name: Strip binary + run: | + sudo apt-get install -y gcc-aarch64-linux-gnu + aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/data-breaker + + - name: Package artifact + run: cp target/aarch64-unknown-linux-gnu/release/data-breaker data-breaker-aarch64-unknown-linux-gnu + + - name: Generate changelog + id: changelog + run: | + prev_tag=$(git tag --sort=-v:refname | sed -n '2p') + if [ -n "$prev_tag" ]; then + log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) + else + log=$(git log --pretty=format:"- %s (%h)" --no-merges) + fi + { + echo "body<> "$GITHUB_OUTPUT" + + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.body }} + files: data-breaker-aarch64-unknown-linux-gnu diff --git a/.github/workflows/release-linux-x86_64.yml b/.github/workflows/release-linux-x86_64.yml new file mode 100644 index 0000000..a3f99a5 --- /dev/null +++ b/.github/workflows/release-linux-x86_64.yml @@ -0,0 +1,50 @@ +name: Release Linux x86_64 + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: jdx/mise-action@v2 + + - name: Add target + run: rustup target add x86_64-unknown-linux-gnu + + - name: Build + run: cargo build --release --target x86_64-unknown-linux-gnu + + - name: Strip binary + run: strip target/x86_64-unknown-linux-gnu/release/data-breaker + + - name: Package artifact + run: cp target/x86_64-unknown-linux-gnu/release/data-breaker data-breaker-x86_64-unknown-linux-gnu + + - name: Generate changelog + id: changelog + run: | + prev_tag=$(git tag --sort=-v:refname | sed -n '2p') + if [ -n "$prev_tag" ]; then + log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) + else + log=$(git log --pretty=format:"- %s (%h)" --no-merges) + fi + { + echo "body<> "$GITHUB_OUTPUT" + + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.body }} + files: data-breaker-x86_64-unknown-linux-gnu diff --git a/.github/workflows/release-macos-aarch64.yml b/.github/workflows/release-macos-aarch64.yml new file mode 100644 index 0000000..eaec542 --- /dev/null +++ b/.github/workflows/release-macos-aarch64.yml @@ -0,0 +1,50 @@ +name: Release macOS aarch64 + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: jdx/mise-action@v2 + + - name: Add target + run: rustup target add aarch64-apple-darwin + + - name: Build + run: cargo build --release --target aarch64-apple-darwin + + - name: Strip binary + run: strip target/aarch64-apple-darwin/release/data-breaker + + - name: Package artifact + run: cp target/aarch64-apple-darwin/release/data-breaker data-breaker-aarch64-apple-darwin + + - name: Generate changelog + id: changelog + run: | + prev_tag=$(git tag --sort=-v:refname | sed -n '2p') + if [ -n "$prev_tag" ]; then + log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) + else + log=$(git log --pretty=format:"- %s (%h)" --no-merges) + fi + { + echo "body<> "$GITHUB_OUTPUT" + + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.body }} + files: data-breaker-aarch64-apple-darwin diff --git a/.github/workflows/release-macos-x86_64.yml b/.github/workflows/release-macos-x86_64.yml new file mode 100644 index 0000000..f99d44f --- /dev/null +++ b/.github/workflows/release-macos-x86_64.yml @@ -0,0 +1,50 @@ +name: Release macOS x86_64 + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: jdx/mise-action@v2 + + - name: Add target + run: rustup target add x86_64-apple-darwin + + - name: Build + run: cargo build --release --target x86_64-apple-darwin + + - name: Strip binary + run: strip target/x86_64-apple-darwin/release/data-breaker + + - name: Package artifact + run: cp target/x86_64-apple-darwin/release/data-breaker data-breaker-x86_64-apple-darwin + + - name: Generate changelog + id: changelog + run: | + prev_tag=$(git tag --sort=-v:refname | sed -n '2p') + if [ -n "$prev_tag" ]; then + log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) + else + log=$(git log --pretty=format:"- %s (%h)" --no-merges) + fi + { + echo "body<> "$GITHUB_OUTPUT" + + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.body }} + files: data-breaker-x86_64-apple-darwin diff --git a/.github/workflows/release-windows-x86_64.yml b/.github/workflows/release-windows-x86_64.yml new file mode 100644 index 0000000..f879893 --- /dev/null +++ b/.github/workflows/release-windows-x86_64.yml @@ -0,0 +1,45 @@ +name: Release Windows x86_64 + +on: + push: + tags: ["v*"] + +permissions: + contents: write + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: jdx/mise-action@v2 + + - name: Build + run: cargo build --release --target x86_64-pc-windows-msvc + + - name: Package artifact + run: cp target/x86_64-pc-windows-msvc/release/data-breaker.exe data-breaker-x86_64-pc-windows-msvc.exe + + - name: Generate changelog + id: changelog + shell: bash + run: | + prev_tag=$(git tag --sort=-v:refname | sed -n '2p') + if [ -n "$prev_tag" ]; then + log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) + else + log=$(git log --pretty=format:"- %s (%h)" --no-merges) + fi + { + echo "body<> "$GITHUB_OUTPUT" + + - uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.body }} + files: data-breaker-x86_64-pc-windows-msvc.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b659fe4..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Release - -on: - push: - tags: ["v*"] - -permissions: - contents: write - -jobs: - build-linux: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - target: x86_64-unknown-linux-gnu - cross: false - - target: aarch64-unknown-linux-gnu - cross: true - - steps: - - uses: actions/checkout@v4 - - - uses: jdx/mise-action@v2 - - - name: Add target - run: rustup target add ${{ matrix.target }} - - - name: Install cross - if: matrix.cross - run: cargo install cross --git https://github.com/cross-rs/cross - - - name: Build - run: | - if [ "${{ matrix.cross }}" = "true" ]; then - cross build --release --target ${{ matrix.target }} - else - cargo build --release --target ${{ matrix.target }} - fi - - - name: Strip binary - run: | - if [ "${{ matrix.cross }}" = "true" ]; then - sudo apt-get install -y gcc-aarch64-linux-gnu - aarch64-linux-gnu-strip target/${{ matrix.target }}/release/data-breaker - else - strip target/${{ matrix.target }}/release/data-breaker - fi - - - name: Package artifact - run: cp target/${{ matrix.target }}/release/data-breaker data-breaker-${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: data-breaker-${{ matrix.target }} - path: data-breaker-${{ matrix.target }} - - build-macos: - runs-on: macos-latest - strategy: - matrix: - include: - - target: x86_64-apple-darwin - - target: aarch64-apple-darwin - - steps: - - uses: actions/checkout@v4 - - - uses: jdx/mise-action@v2 - - - name: Add target - run: rustup target add ${{ matrix.target }} - - - name: Build - run: cargo build --release --target ${{ matrix.target }} - - - name: Strip binary - run: strip target/${{ matrix.target }}/release/data-breaker - - - name: Package artifact - run: cp target/${{ matrix.target }}/release/data-breaker data-breaker-${{ matrix.target }} - - - uses: actions/upload-artifact@v4 - with: - name: data-breaker-${{ matrix.target }} - path: data-breaker-${{ matrix.target }} - - build-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - uses: jdx/mise-action@v2 - - - name: Build - run: cargo build --release --target x86_64-pc-windows-msvc - - - name: Package artifact - run: cp target/x86_64-pc-windows-msvc/release/data-breaker.exe data-breaker-x86_64-pc-windows-msvc.exe - - - uses: actions/upload-artifact@v4 - with: - name: data-breaker-x86_64-pc-windows-msvc - path: data-breaker-x86_64-pc-windows-msvc.exe - - release: - needs: [build-linux, build-macos, build-windows] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/download-artifact@v4 - with: - path: artifacts - merge-multiple: true - - - name: Generate changelog - id: changelog - run: | - prev_tag=$(git tag --sort=-v:refname | sed -n '2p') - if [ -n "$prev_tag" ]; then - log=$(git log "${prev_tag}..HEAD" --pretty=format:"- %s (%h)" --no-merges) - else - log=$(git log --pretty=format:"- %s (%h)" --no-merges) - fi - { - echo "body<> "$GITHUB_OUTPUT" - - - uses: softprops/action-gh-release@v2 - with: - body: ${{ steps.changelog.outputs.body }} - files: artifacts/* diff --git a/README.md b/README.md index 60c3fab..67abbaa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ [![CI](https://github.com/bombfork/data-breaker/actions/workflows/ci.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/ci.yml) -[![Release](https://github.com/bombfork/data-breaker/actions/workflows/release.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release.yml) +[![Release Linux x86_64](https://github.com/bombfork/data-breaker/actions/workflows/release-linux-x86_64.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release-linux-x86_64.yml) +[![Release Linux aarch64](https://github.com/bombfork/data-breaker/actions/workflows/release-linux-aarch64.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release-linux-aarch64.yml) +[![Release macOS x86_64](https://github.com/bombfork/data-breaker/actions/workflows/release-macos-x86_64.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release-macos-x86_64.yml) +[![Release macOS aarch64](https://github.com/bombfork/data-breaker/actions/workflows/release-macos-aarch64.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release-macos-aarch64.yml) +[![Release Windows x86_64](https://github.com/bombfork/data-breaker/actions/workflows/release-windows-x86_64.yml/badge.svg)](https://github.com/bombfork/data-breaker/actions/workflows/release-windows-x86_64.yml) # data-breaker