on:
push:
branches:
- main
name: release-please
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release Please
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: rust
package-name: release-please-action
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install rust
uses: actions-rs/toolchain@v1
if: ${{ steps.release.outputs.release_created }}
with:
toolchain: stable
profile: minimal
override: true
- name: Cache
uses: Swatinem/rust-cache@v2
if: ${{ steps.release.outputs.release_created }}
- name: Publish to crates.io
if: ${{ steps.release.outputs.release_created }}
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}