From 7bc135fb8141666c0224580d4d0ce6044157e13d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Mon, 24 Jun 2024 00:36:58 +1000 Subject: [PATCH] Update publish.yml to use release-plz (#1101) Release-plz would automatically creates a release PR on commits to main, and bumps the version. --- .github/workflows/publish.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9097444b..cc5bc4ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,27 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + on: push: - tags: - - '*' + branches: + - main jobs: - publish: + release-plz: + name: Release-plz runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Publish to crates.io - run: | - cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}