From 33e23bb45471e1e046a0dd1595e99df18e50a394 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 19:01:41 +1000 Subject: [PATCH] Usw release-plz in publish.yml (#26) --- .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 9097444..cc5bc4f 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 }}