diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 987de6b..439cf6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release-plz +name: Auto Release on: workflow_run: @@ -6,52 +6,8 @@ on: types: [completed] jobs: - # Release unpublished packages. - release-plz-release: - name: Release-plz release - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'master' }} - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - persist-credentials: false - - 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_TOKEN }} - - # Create a PR with the new versions and changelog, preparing the next release. - release-plz-pr: - name: Release-plz PR - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'master' }} - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - concurrency: - group: release-plz-${{ github.ref }} - cancel-in-progress: false - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - persist-credentials: false - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - 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_TOKEN }} + release: + if: ${{ github.repository == 'casbin-rs/redis-watcher' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'master'}} + uses: casbin-rs/semantic-release-action-rust/.github/workflows/release-library.yml@master + secrets: + cargo-registry-token: ${{ secrets.CARGO_TOKEN }}