From c79a8ab54f3601c17959b62d190dbf18bfa97def Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 28 Aug 2026 09:13:20 -0600 Subject: [PATCH] fix(ci): build requested release refs consistently cx --- .github/workflows/build-qt-linux.yml | 11 +++++++++++ .github/workflows/release-flatpak.yml | 15 +++++++++++++++ .github/workflows/release-linux-aarch64.yml | 8 +++++++- .github/workflows/release-linux.yml | 8 +++++++- .github/workflows/release-windows.yml | 2 +- 5 files changed, 41 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-qt-linux.yml b/.github/workflows/build-qt-linux.yml index 073c8eb7b..abd1f1006 100644 --- a/.github/workflows/build-qt-linux.yml +++ b/.github/workflows/build-qt-linux.yml @@ -40,6 +40,11 @@ on: description: "x86_64 | aarch64" required: true type: string + source_ref: + description: "Optional branch, tag or SHA to build" + required: false + default: "" + type: string outputs: version: description: "Workspace version from crates/Cargo.toml" @@ -52,6 +57,10 @@ on: default: x86_64 type: choice options: [x86_64, aarch64] + source_ref: + description: "Optional branch, tag or SHA to build. Empty = dispatched ref." + required: false + type: string # The Qt pin. Repository variables win (set QT_VERSION_LINUX in Settings → # Variables to bump without a commit); the literal is the measured floor. @@ -71,6 +80,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + ref: ${{ inputs.source_ref || github.ref }} - name: Workspace version id: version diff --git a/.github/workflows/release-flatpak.yml b/.github/workflows/release-flatpak.yml index 92e0ef501..c42a5cce4 100644 --- a/.github/workflows/release-flatpak.yml +++ b/.github/workflows/release-flatpak.yml @@ -28,6 +28,7 @@ jobs: uses: ./.github/workflows/build-qt-linux.yml with: arch: x86_64 + source_ref: ${{ inputs.tag || github.ref }} # qbzd rides in the bundle too (same as deb/rpm). Slint-free, minutes-class. build-qbzd: @@ -35,6 +36,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} - uses: dtolnay/rust-toolchain@stable - run: sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-jackd2-dev libdbus-1-dev libssl-dev - run: cargo build --release --manifest-path crates/Cargo.toml -p qbzd @@ -51,6 +54,7 @@ jobs: - name: Checkout uses: actions/checkout@v7 with: + ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 - name: Resolve release version @@ -79,6 +83,17 @@ jobs: exit 1 fi + - name: Assert Cargo.toml version matches requested tag + if: startsWith(github.ref, 'refs/tags/') || inputs.tag != '' + env: + VERSION: ${{ steps.release.outputs.version }} + run: | + CARGO_VERSION="$(grep -m1 '^version = ' crates/Cargo.toml | sed 's/version = "\(.*\)"/\1/')" + if [[ "$CARGO_VERSION" != "$VERSION" ]]; then + echo "::error::crates/Cargo.toml workspace version ($CARGO_VERSION) != requested version ($VERSION)." + exit 1 + fi + # Keep the metainfo's top entry honest (version + date). - name: Sync metainfo release entry if: steps.release.outputs.version != '' diff --git a/.github/workflows/release-linux-aarch64.yml b/.github/workflows/release-linux-aarch64.yml index 635e4acd6..f07c5f59f 100644 --- a/.github/workflows/release-linux-aarch64.yml +++ b/.github/workflows/release-linux-aarch64.yml @@ -55,6 +55,7 @@ jobs: steps: - uses: actions/checkout@v7 with: + ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 - name: Resolve release version @@ -93,7 +94,7 @@ jobs: # The binary embeds the workspace version (About, diagnostics); a # mismatched tag would ship a binary that reports the wrong version. - name: Assert Cargo.toml version matches tag - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || inputs.tag != '' env: VERSION: ${{ steps.release.outputs.version }} run: | @@ -117,6 +118,7 @@ jobs: uses: ./.github/workflows/build-qt-linux.yml with: arch: aarch64 + source_ref: ${{ inputs.tag || github.ref }} # qbzd is minutes-class and Slint-free. Runs on ubuntu-22.04 so the shipped # binary's glibc floor stays <= Pi OS bookworm's 2.36 (the honest-Pi-story @@ -126,6 +128,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} - uses: dtolnay/rust-toolchain@stable - name: system deps run: sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-jackd2-dev libdbus-1-dev libssl-dev @@ -158,6 +162,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} - name: Download bare binary uses: actions/download-artifact@v8 diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 1d9d806de..b5b289dd8 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -55,6 +55,7 @@ jobs: steps: - uses: actions/checkout@v7 with: + ref: ${{ inputs.tag || github.ref }} fetch-depth: 0 - name: Resolve release version @@ -93,7 +94,7 @@ jobs: # The binary embeds the workspace version (About, diagnostics); a # mismatched tag would ship a binary that reports the wrong version. - name: Assert Cargo.toml version matches tag - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || inputs.tag != '' env: VERSION: ${{ steps.release.outputs.version }} run: | @@ -117,6 +118,7 @@ jobs: uses: ./.github/workflows/build-qt-linux.yml with: arch: x86_64 + source_ref: ${{ inputs.tag || github.ref }} # qbzd is minutes-class and Slint-free. Runs on ubuntu-22.04 so the shipped # binary's glibc floor stays <= Pi OS bookworm's 2.36 (the honest-Pi-story @@ -126,6 +128,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} - uses: dtolnay/rust-toolchain@stable - name: system deps run: sudo apt-get update && sudo apt-get install -y libasound2-dev libjack-jackd2-dev libdbus-1-dev libssl-dev @@ -158,6 +162,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + ref: ${{ inputs.tag || github.ref }} - name: Download bare binary uses: actions/download-artifact@v8 diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 1ff5fb8a4..250a5c1b3 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -106,7 +106,7 @@ jobs: fi - name: Assert Cargo.toml version matches tag - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || inputs.tag != '' env: VERSION: ${{ steps.release.outputs.version }} run: |