From f7bbf60655e5964c7f629960e88eb98e829df946 Mon Sep 17 00:00:00 2001 From: Dragosh <39906742+0dragosh@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:59:49 +0300 Subject: [PATCH] fix: build linux release assets on ubuntu 22.04 --- .github/workflows/release-plz.yml | 6 ++++-- tests/integration.rs | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 5917dcf..7e7a9ec 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -55,9 +55,11 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest + # Build GNU Linux binaries on Jammy so they remain compatible with + # Ubuntu 22.04's glibc baseline and newer distributions. + - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu - - os: ubuntu-latest + - os: ubuntu-22.04 target: aarch64-unknown-linux-gnu - os: macos-15-intel target: x86_64-apple-darwin diff --git a/tests/integration.rs b/tests/integration.rs index 8743401..22beeb3 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -179,6 +179,27 @@ fn read_state(repo_root: &Path) -> serde_json::Value { serde_json::from_str(&content).expect("failed to parse state.json") } +#[test] +fn test_release_linux_binaries_target_ubuntu_22_04() { + let workflow = std::fs::read_to_string( + PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(".github/workflows/release-plz.yml"), + ) + .expect("read release workflow"); + + for target in ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"] { + let expected = format!(" - os: ubuntu-22.04\n target: {target}"); + let old = format!(" - os: ubuntu-latest\n target: {target}"); + assert!( + workflow.contains(&expected), + "release workflow should build {target} on ubuntu-22.04 for glibc compatibility" + ); + assert!( + !workflow.contains(&old), + "release workflow should not build {target} on ubuntu-latest" + ); + } +} + // =========================================================================== // Worktree CRUD // ===========================================================================