From 8347cd82dd5ebec671e6fa667494c8cc26c4c534 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 26 Mar 2024 17:57:18 +0800 Subject: [PATCH] ci: add release-plz --- .github/workflows/publish_crate.yml | 44 ----------------------------- .github/workflows/release-plz.yml | 31 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/publish_crate.yml create mode 100644 .github/workflows/release-plz.yml diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml deleted file mode 100644 index 13200626..00000000 --- a/.github/workflows/publish_crate.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish Crate - -on: - push: - branches: - - main - paths: - - Cargo.toml - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - permissions: - contents: write # for softprops/action-gh-release@v1 - steps: - - uses: actions/checkout@v4 - - - name: Install Rust Toolchain - uses: ./.github/actions/rustup - with: - save-cache: false - - - name: Cargo check - run: cargo check --locked - - - uses: katyo/publish-crates@v2 - id: publish - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} - ignore-unpublished-changes: true - - - name: Create GitHub Release - if: steps.publish.outcome == 'success' - uses: softprops/action-gh-release@v2 - with: - name: v${{ join(fromJSON(steps.publish.outputs.published).version, '') }} - draft: true - fail_on_unmatched_files: true - generate_release_notes: true diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..857c8fe8 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,31 @@ +name: Release Plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Rust Toolchain + uses: ./.github/actions/rustup + with: + save-cache: false + + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}