From 1b448b9d7530be3cd4af8c1dec06c265387c94a7 Mon Sep 17 00:00:00 2001 From: Milind Sharma Date: Sun, 22 Feb 2026 20:40:05 +0800 Subject: [PATCH] ci: fix release-plz workflow for auto release on main (#10) * Create release-plz.yml * ci: configure release-plz auto-release workflow * ci: allow crates token from env vars fallback * ci: add release-pr flow and release commit filtering --- .github/workflows/release-plz.yml | 54 +++++++++++++++++++++++++++++++ release-plz.toml | 6 ++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/release-plz.yml create mode 100644 release-plz.toml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..d048f4a --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,54 @@ +name: release-plz + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + release-plz-release: + name: release-plz release + runs-on: ubuntu-latest + permissions: + contents: write + environment: CRATE_RELEASE + steps: + - &checkout + name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + + - &install-rust + name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN || vars.CARGO_REGISTRY_TOKEN }} + + release-plz-pr: + name: release-plz PR + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - *checkout + - *install-rust + - name: Run release-plz + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN || vars.CARGO_REGISTRY_TOKEN }} diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..79f4197 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,6 @@ +[workspace] +release_always = true +git_tag_enable = true +git_release_enable = true +publish = true +release_commits = '^(feat|fix|perf|refactor|revert|build)(\([^)]+\))?(!)?:'