fix(ci): build requested release refs consistently
cx
This commit is contained in:
5 files changed
+41
-3
No files matched your search
@@ -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
|
||||
|
||||
@@ -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 <release> entry honest (version + date).
|
||||
- name: Sync metainfo release entry
|
||||
if: steps.release.outputs.version != ''
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: |
|
||||
|
||||
Reference in new issue
Block a user