From 2819329fada8828bf7cd0bb61967f8a131d00de0 Mon Sep 17 00:00:00 2001 From: Leynos Date: Fri, 1 Aug 2025 10:18:47 +0100 Subject: [PATCH 1/4] Document Linux-only release --- .github/workflows/release.yml | 122 ++++----------------- Cargo.toml | 2 +- docs/automated-cross-platform-packaging.md | 9 +- docs/comenq-design.md | 4 +- docs/roadmap.md | 8 +- src/lib.rs | 1 + src/workflow.rs | 57 ++++++++++ tests/cucumber.rs | 4 +- tests/features/release.feature | 11 ++ tests/steps/mod.rs | 2 + tests/steps/release_steps.rs | 54 +++++++++ 11 files changed, 162 insertions(+), 112 deletions(-) create mode 100644 src/workflow.rs create mode 100644 tests/features/release.feature create mode 100644 tests/steps/release_steps.rs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c68571..a57532d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,116 +1,36 @@ - -name: Release Binary +name: Release on: push: tags: - - 'v*.*.*' - -env: - REPO_NAME: ${{ github.event.repository.name }} + - 'v*' jobs: - build: + goreleaser: runs-on: ubuntu-latest - strategy: - matrix: - include: - - os: linux - arch: x86_64 - target: x86_64-unknown-linux-gnu - ext: "" - - os: linux - arch: aarch64 - target: aarch64-unknown-linux-gnu - ext: "" - - os: windows - arch: x86_64 - target: x86_64-pc-windows-msvc - ext: ".exe" - - os: windows - arch: aarch64 - target: aarch64-pc-windows-msvc - ext: ".exe" - - os: macos - arch: x86_64 - target: x86_64-apple-darwin - ext: "" - - os: macos - arch: aarch64 - target: aarch64-apple-darwin - ext: "" - - os: freebsd - arch: x86_64 - target: x86_64-unknown-freebsd - ext: "" - - os: freebsd - arch: aarch64 - target: aarch64-unknown-freebsd - ext: "" - - os: openbsd - arch: x86_64 - target: x86_64-unknown-openbsd - ext: "" - - os: openbsd - arch: aarch64 - target: aarch64-unknown-openbsd - ext: "" steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - - name: Cache cross binary - uses: actions/cache@v4 + targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + - name: Set up Go + uses: actions/setup-go@v5 with: - path: ~/.cargo/bin/cross - key: cross-${{ runner.os }} - - name: Install cross - run: cargo install cross --git https://github.com/cross-rs/cross - - name: Cache cargo registry - uses: actions/cache@v4 + go-version: '1.21' + - name: Install GoReleaser + uses: goreleaser/goreleaser-action@v5 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - name: Build release binary - run: cross +stable build --release --target ${{ matrix.target }} - - name: Prepare artifact - run: | - mkdir -p artifacts/${{ matrix.os }}-${{ matrix.arch }} - cp target/${{ matrix.target }}/release/${{ env.REPO_NAME }}${{ matrix.ext }} \ - artifacts/${{ matrix.os }}-${{ matrix.arch }}/${{ env.REPO_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }} - sha256sum artifacts/${{ matrix.os }}-${{ matrix.arch }}/${{ env.REPO_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }} > \ - artifacts/${{ matrix.os }}-${{ matrix.arch }}/${{ env.REPO_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}.sha256 - - name: Upload release artifact - uses: actions/upload-artifact@v4 + install-only: true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 with: - name: ${{ env.REPO_NAME }}-${{ matrix.os }}-${{ matrix.arch }} - path: artifacts/${{ matrix.os }}-${{ matrix.arch }} - - release: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: softprops/action-gh-release@v1 - with: - generate_release_notes: true - - uses: actions/download-artifact@v4 - with: - path: artifacts - - run: | - for dir in artifacts/${{ env.REPO_NAME }}-*; do - for file in "$dir"/*; do - gh release upload "${{ github.ref_name }}" "$file" - done - done + distribution: goreleaser + version: latest + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/Cargo.toml b/Cargo.toml index 57bf4b2..4b7d43a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ path = "src/lib.rs" [dependencies] serde = { workspace = true } +serde_yaml = "0.9" serde_json = { workspace = true } [dev-dependencies] @@ -22,7 +23,6 @@ yaque = { workspace = true } wiremock = "0.6" octocrab = { workspace = true } test-support = { path = "test-support" } -serde_yaml = "0.9" [[test]] name = "cucumber" diff --git a/docs/automated-cross-platform-packaging.md b/docs/automated-cross-platform-packaging.md index 631686d..a5bc02f 100644 --- a/docs/automated-cross-platform-packaging.md +++ b/docs/automated-cross-platform-packaging.md @@ -4,9 +4,10 @@ This guide provides a step-by-step process for configuring a GitHub Actions workflow to automatically build and package the `comenq` client and `comenqd` -daemon for Linux (Fedora, Ubuntu) and macOS. We will use GoReleaser to manage -the entire process, from building the Rust binaries to creating platform-native -packages (`.rpm`, `.deb`) and a Homebrew formula. +daemon for Linux (Fedora, Ubuntu) and macOS. Mac OS packaging is currently on +hold, so the workflow focuses on Linux targets only. We will use GoReleaser to +manage the entire process, from building the Rust binaries to creating +platform-native packages (`.rpm`, `.deb`) and a Homebrew formula. The core of this process involves creating a `.goreleaser.yaml` file that declaratively defines the build, packaging, and release steps. This file will @@ -277,7 +278,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: stable - targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin + targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu - name: Set up Go uses: actions/setup-go@v5 diff --git a/docs/comenq-design.md b/docs/comenq-design.md index a7e1686..9ccff4d 100644 --- a/docs/comenq-design.md +++ b/docs/comenq-design.md @@ -721,7 +721,9 @@ To simplify installation, the project uses GoReleaser. The declarative hooks. The `nfpms` section produces signed `.deb` and `.rpm` packages for Fedora and Ubuntu, embedding the hardened `systemd` service unit and lifecycle scripts that create the `comenq` user. This keeps packaging logic version -controlled and repeatable. +controlled and repeatable. A GitHub Actions workflow triggers on version tags +to run GoReleaser. It builds Linux packages and uploads them to a draft +release. Mac support is currently deferred so the workflow targets Linux only. ## Section 5: Complete Source Code and Project Manifest diff --git a/docs/roadmap.md b/docs/roadmap.md index 4292ea6..4761c69 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -105,15 +105,15 @@ and macOS, simplifying installation and improving security and maintainability. - [x] Configure GoReleaser's `nfpms` section to build and sign `.rpm` and `.deb` packages. -- [ ] **Automate the Release Workflow** +- [x] **Automate the Release Workflow** - - [ ] Implement a GitHub Actions workflow that triggers on new version tags + - [x] Implement a GitHub Actions workflow that triggers on new version tags (e.g., `v*`). - - [ ] The workflow will orchestrate the entire release: checking out the + - [x] The workflow will orchestrate the entire release: checking out the code, installing dependencies, and executing GoReleaser. - - [ ] GoReleaser will then build the binaries, create all packages, publish + - [x] GoReleaser will then build the binaries, create all packages, publish the Homebrew formula, generate a changelog from git history, and upload all assets to a draft GitHub Release. diff --git a/src/lib.rs b/src/lib.rs index 7562f44..36eb3e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,7 @@ //! and daemon. use serde::{Deserialize, Serialize}; +pub mod workflow; /// Request sent from the client to the daemon. #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] diff --git a/src/workflow.rs b/src/workflow.rs new file mode 100644 index 0000000..89b69f1 --- /dev/null +++ b/src/workflow.rs @@ -0,0 +1,57 @@ +//! Utilities for inspecting GitHub workflow files. + +use serde_yaml::Value; + +/// Return `true` if the workflow steps include the `GoReleaser` action. +/// +/// # Errors +/// +/// Returns an error if the YAML cannot be parsed. +pub fn uses_goreleaser(yaml: &str) -> Result { + let doc: Value = serde_yaml::from_str(yaml)?; + let Some(jobs) = doc.get("jobs") else { + return Ok(false); + }; + let Some(goreleaser) = jobs.get("goreleaser") else { + return Ok(false); + }; + let Some(steps) = goreleaser.get("steps") else { + return Ok(false); + }; + let Some(arr) = steps.as_sequence() else { + return Ok(false); + }; + for step in arr { + if let Some(uses) = step.get("uses") + && uses + .as_str() + .is_some_and(|s| s.contains("goreleaser-action")) + { + return Ok(true); + } + } + Ok(false) +} + +#[cfg(test)] +mod tests { + #![expect(clippy::expect_used, reason = "simplify test output")] + use super::uses_goreleaser; + + #[test] + fn detects_goreleaser() { + let yaml = r" + jobs: + goreleaser: + steps: + - uses: goreleaser/goreleaser-action@v5 + "; + assert!(uses_goreleaser(yaml).expect("parse")); + } + + #[test] + fn missing_goreleaser() { + let yaml = "jobs: {}"; + assert!(!uses_goreleaser(yaml).expect("parse")); + } +} diff --git a/tests/cucumber.rs b/tests/cucumber.rs index cabfd77..fd68b79 100644 --- a/tests/cucumber.rs +++ b/tests/cucumber.rs @@ -2,13 +2,15 @@ mod steps; mod support; use cucumber::World as _; use steps::{ - CliWorld, ClientWorld, CommentWorld, ConfigWorld, ListenerWorld, PackagingWorld, WorkerWorld, + CliWorld, ClientWorld, CommentWorld, ConfigWorld, ListenerWorld, PackagingWorld, ReleaseWorld, + WorkerWorld, }; #[tokio::main] async fn main() { tokio::join!( CliWorld::run("tests/features/cli.feature"), + ReleaseWorld::run("tests/features/release.feature"), ClientWorld::run("tests/features/client_main.feature"), CommentWorld::run("tests/features/comment_request.feature"), ConfigWorld::run("tests/features/config.feature"), diff --git a/tests/features/release.feature b/tests/features/release.feature new file mode 100644 index 0000000..b65566a --- /dev/null +++ b/tests/features/release.feature @@ -0,0 +1,11 @@ +Feature: Release workflow + + Scenario: goreleaser step present + Given the release workflow file + When it is parsed as YAML + Then the workflow uses goreleaser + + Scenario: triggers on version tags + Given the release workflow file + When it is parsed as YAML + Then the workflow triggers on tags diff --git a/tests/steps/mod.rs b/tests/steps/mod.rs index ed49745..1c51a54 100644 --- a/tests/steps/mod.rs +++ b/tests/steps/mod.rs @@ -12,3 +12,5 @@ pub mod packaging_steps; pub use packaging_steps::PackagingWorld; pub mod worker_steps; pub use worker_steps::WorkerWorld; +pub mod release_steps; +pub use release_steps::ReleaseWorld; diff --git a/tests/steps/release_steps.rs b/tests/steps/release_steps.rs new file mode 100644 index 0000000..bec1323 --- /dev/null +++ b/tests/steps/release_steps.rs @@ -0,0 +1,54 @@ +//! Behavioural steps for the release workflow. +#![expect(clippy::expect_used, reason = "simplify test failure output")] + +use cucumber::{World, given, then, when}; +use serde_yaml::Value; +use std::fs; + +#[derive(Debug, Default, World)] +pub struct ReleaseWorld { + content: Option, + yaml: Option, +} + +#[given("the release workflow file")] +fn the_workflow_file(world: &mut ReleaseWorld) { + let text = fs::read_to_string(".github/workflows/release.yml").expect("read workflow"); + world.content = Some(text); +} + +#[when("it is parsed as YAML")] +fn parse_yaml(world: &mut ReleaseWorld) { + let text = world.content.take().expect("file loaded"); + world.yaml = Some(serde_yaml::from_str(&text).expect("parse yaml")); +} + +#[then("the workflow uses goreleaser")] +fn uses_goreleaser(world: &mut ReleaseWorld) { + let yaml = world.yaml.as_ref().expect("yaml parsed"); + let jobs = yaml.get("jobs").expect("jobs"); + let goreleaser = jobs.get("goreleaser").expect("goreleaser job"); + let steps = goreleaser + .get("steps") + .expect("steps") + .as_sequence() + .expect("sequence"); + assert!(steps.iter().any(|s| { + s.get("uses") + .and_then(|u| u.as_str()) + .is_some_and(|u| u.contains("goreleaser-action")) + })); +} + +#[then("the workflow triggers on tags")] +fn triggers_on_tags(world: &mut ReleaseWorld) { + let yaml = world.yaml.as_ref().expect("yaml parsed"); + let on = yaml.get("on").expect("on"); + let push = on.get("push").expect("push"); + let tags = push + .get("tags") + .expect("tags") + .as_sequence() + .expect("sequence"); + assert!(tags.iter().any(|t| t.as_str() == Some("v*"))); +} From e2dd357d0f1a97defab7a8bcc9648eaa9b0d2866 Mon Sep 17 00:00:00 2001 From: Leynos Date: Fri, 1 Aug 2025 12:19:37 +0100 Subject: [PATCH 2/4] Update release workflow and tests --- .github/workflows/release.yml | 6 +++-- docs/automated-cross-platform-packaging.md | 11 ++++---- docs/comenq-design.md | 2 +- src/workflow.rs | 30 ++++++++++++---------- tests/steps/mod.rs | 8 +++--- tests/steps/release_steps.rs | 27 ++++++++----------- 6 files changed, 41 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a57532d..62be0d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - 'v*' + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: goreleaser: @@ -18,6 +18,7 @@ jobs: with: toolchain: stable targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + cache: cargo - name: Set up Go uses: actions/setup-go@v5 with: @@ -30,7 +31,8 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser - version: latest + # Use a fixed version to ensure reproducibility + version: v1.24.0 args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/automated-cross-platform-packaging.md b/docs/automated-cross-platform-packaging.md index a5bc02f..4b7d756 100644 --- a/docs/automated-cross-platform-packaging.md +++ b/docs/automated-cross-platform-packaging.md @@ -4,10 +4,10 @@ This guide provides a step-by-step process for configuring a GitHub Actions workflow to automatically build and package the `comenq` client and `comenqd` -daemon for Linux (Fedora, Ubuntu) and macOS. Mac OS packaging is currently on -hold, so the workflow focuses on Linux targets only. We will use GoReleaser to -manage the entire process, from building the Rust binaries to creating -platform-native packages (`.rpm`, `.deb`) and a Homebrew formula. +daemon for Linux (Fedora, Ubuntu) and macOS. macOS packaging is currently on +hold, so the workflow focuses on Linux targets only. GoReleaser manages the +entire process, from building the Rust binaries to creating platform-native +packages (`.rpm`, `.deb`) and a Homebrew formula. The core of this process involves creating a `.goreleaser.yaml` file that declaratively defines the build, packaging, and release steps. This file will @@ -279,6 +279,7 @@ jobs: with: toolchain: stable targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu + cache: cargo - name: Set up Go uses: actions/setup-go@v5 @@ -294,7 +295,7 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser - version: latest + version: v1.24.0 args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/comenq-design.md b/docs/comenq-design.md index 9ccff4d..452834c 100644 --- a/docs/comenq-design.md +++ b/docs/comenq-design.md @@ -723,7 +723,7 @@ Fedora and Ubuntu, embedding the hardened `systemd` service unit and lifecycle scripts that create the `comenq` user. This keeps packaging logic version controlled and repeatable. A GitHub Actions workflow triggers on version tags to run GoReleaser. It builds Linux packages and uploads them to a draft -release. Mac support is currently deferred so the workflow targets Linux only. +release. Mac support is currently deferred, so the workflow targets Linux only. ## Section 5: Complete Source Code and Project Manifest diff --git a/src/workflow.rs b/src/workflow.rs index 89b69f1..0d09fc6 100644 --- a/src/workflow.rs +++ b/src/workflow.rs @@ -12,22 +12,24 @@ pub fn uses_goreleaser(yaml: &str) -> Result { let Some(jobs) = doc.get("jobs") else { return Ok(false); }; - let Some(goreleaser) = jobs.get("goreleaser") else { + let Some(map) = jobs.as_mapping() else { return Ok(false); }; - let Some(steps) = goreleaser.get("steps") else { - return Ok(false); - }; - let Some(arr) = steps.as_sequence() else { - return Ok(false); - }; - for step in arr { - if let Some(uses) = step.get("uses") - && uses - .as_str() - .is_some_and(|s| s.contains("goreleaser-action")) - { - return Ok(true); + for job in map.values() { + let Some(steps) = job.get("steps") else { + continue; + }; + let Some(arr) = steps.as_sequence() else { + continue; + }; + for step in arr { + if step + .get("uses") + .and_then(|u| u.as_str()) + .is_some_and(|s| s.starts_with("goreleaser/goreleaser-action")) + { + return Ok(true); + } } } Ok(false) diff --git a/tests/steps/mod.rs b/tests/steps/mod.rs index 1c51a54..6ae9030 100644 --- a/tests/steps/mod.rs +++ b/tests/steps/mod.rs @@ -1,7 +1,7 @@ -pub mod client_main_steps; -pub use client_main_steps::ClientWorld; pub mod cli_steps; pub use cli_steps::CliWorld; +pub mod client_main_steps; +pub use client_main_steps::ClientWorld; pub mod comment_steps; pub use comment_steps::CommentWorld; pub mod config_steps; @@ -10,7 +10,7 @@ pub mod listener_steps; pub use listener_steps::ListenerWorld; pub mod packaging_steps; pub use packaging_steps::PackagingWorld; -pub mod worker_steps; -pub use worker_steps::WorkerWorld; pub mod release_steps; pub use release_steps::ReleaseWorld; +pub mod worker_steps; +pub use worker_steps::WorkerWorld; diff --git a/tests/steps/release_steps.rs b/tests/steps/release_steps.rs index bec1323..b825dc0 100644 --- a/tests/steps/release_steps.rs +++ b/tests/steps/release_steps.rs @@ -1,6 +1,7 @@ //! Behavioural steps for the release workflow. #![expect(clippy::expect_used, reason = "simplify test failure output")] +use comenq_lib::workflow::uses_goreleaser as workflow_uses_goreleaser; use cucumber::{World, given, then, when}; use serde_yaml::Value; use std::fs; @@ -19,25 +20,14 @@ fn the_workflow_file(world: &mut ReleaseWorld) { #[when("it is parsed as YAML")] fn parse_yaml(world: &mut ReleaseWorld) { - let text = world.content.take().expect("file loaded"); - world.yaml = Some(serde_yaml::from_str(&text).expect("parse yaml")); + let text = world.content.as_deref().expect("file loaded"); + world.yaml = Some(serde_yaml::from_str(text).expect("parse yaml")); } #[then("the workflow uses goreleaser")] -fn uses_goreleaser(world: &mut ReleaseWorld) { - let yaml = world.yaml.as_ref().expect("yaml parsed"); - let jobs = yaml.get("jobs").expect("jobs"); - let goreleaser = jobs.get("goreleaser").expect("goreleaser job"); - let steps = goreleaser - .get("steps") - .expect("steps") - .as_sequence() - .expect("sequence"); - assert!(steps.iter().any(|s| { - s.get("uses") - .and_then(|u| u.as_str()) - .is_some_and(|u| u.contains("goreleaser-action")) - })); +fn assert_uses_goreleaser(world: &mut ReleaseWorld) { + let content = world.content.as_ref().expect("file still loaded"); + assert!(workflow_uses_goreleaser(content).expect("parse")); } #[then("the workflow triggers on tags")] @@ -50,5 +40,8 @@ fn triggers_on_tags(world: &mut ReleaseWorld) { .expect("tags") .as_sequence() .expect("sequence"); - assert!(tags.iter().any(|t| t.as_str() == Some("v*"))); + assert!( + tags.iter() + .any(|t| t.as_str() == Some("v[0-9]+.[0-9]+.[0-9]+")) + ); } From c280d27ad0df9f64e685d345244d6031a9bd1c03 Mon Sep 17 00:00:00 2001 From: Leynos Date: Fri, 1 Aug 2025 18:02:24 +0100 Subject: [PATCH 3/4] Update release workflow and promote serde_yaml --- .github/workflows/release.yml | 7 ++----- Cargo.toml | 3 ++- docs/automated-cross-platform-packaging.md | 7 +------ tests/steps/release_steps.rs | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62be0d7..7ae78e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,8 @@ name: Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + # Match semantic version tags (e.g. v1.2.3, v10.11.12) + - 'v[0-9]*.[0-9]*.[0-9]*' jobs: goreleaser: @@ -23,10 +24,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.21' - - name: Install GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - install-only: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/Cargo.toml b/Cargo.toml index 4b7d43a..cb2b405 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ path = "src/lib.rs" [dependencies] serde = { workspace = true } -serde_yaml = "0.9" +serde_yaml = { workspace = true } serde_json = { workspace = true } [dev-dependencies] @@ -48,6 +48,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } anyhow = "1.0" thiserror = "1.0" ortho_config = { git = "https://github.com/leynos/ortho-config.git", tag = "v0.4.0" } +serde_yaml = "0.9" [lints.clippy] pedantic = { level = "warn", priority = -1 } diff --git a/docs/automated-cross-platform-packaging.md b/docs/automated-cross-platform-packaging.md index 4b7d756..ac71089 100644 --- a/docs/automated-cross-platform-packaging.md +++ b/docs/automated-cross-platform-packaging.md @@ -263,7 +263,7 @@ name: Release on: push: tags: - - 'v*' + - 'v[0-9]*.[0-9]*.[0-9]*' jobs: goreleaser: @@ -286,11 +286,6 @@ jobs: with: go-version: '1.21' - - name: Install GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - install-only: true - - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/tests/steps/release_steps.rs b/tests/steps/release_steps.rs index b825dc0..5726318 100644 --- a/tests/steps/release_steps.rs +++ b/tests/steps/release_steps.rs @@ -42,6 +42,6 @@ fn triggers_on_tags(world: &mut ReleaseWorld) { .expect("sequence"); assert!( tags.iter() - .any(|t| t.as_str() == Some("v[0-9]+.[0-9]+.[0-9]+")) + .any(|t| t.as_str() == Some("v[0-9]*.[0-9]*.[0-9]*")) ); } From 1d3c8dd7094284f2de7bb7ae5236bf2326a31cee Mon Sep 17 00:00:00 2001 From: Leynos Date: Fri, 1 Aug 2025 21:33:55 +0100 Subject: [PATCH 4/4] More liberal tagging pattern --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ae78e3..87b2816 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,8 @@ name: Release on: push: tags: - # Match semantic version tags (e.g. v1.2.3, v10.11.12) - - 'v[0-9]*.[0-9]*.[0-9]*' + # Match semantic version tags (e.g. v1.2.3, v10.11.12, v12.3.7-beta7) + - 'v*.*.*' jobs: goreleaser: