GitHub Action for publishing pushed
changes from a pull request
with a release label
to https://crates.io/.
This GitHub action can be used either to publish the crate[1] or to check if it's releasable. It depends on the execution context.
[1]: Workspaces aren't supported yet.
The push triggering this event must have come from a Pull Request. This action bumps the semantic version, depending on the release label from the original Pull Request, and publishes the crate.
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
environment: Release
name: Release
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: nash-ws/cargo-release-action@main
with:
major-label: major
minor-label: minor
patch-label: patch
cargo-token: ${{ secrets.CARGO_TOKEN }}
For checking if the crate is releasable.
- Checks if the Pull Request has a release label.
- Checks if the crate is publishable with
cargo publish
.
on:
pull_request:
branches:
- main
jobs:
check-release:
runs-on: ubuntu-latest
name: Check Release
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: nash-ws/cargo-release-action@main
with:
major-label: major
minor-label: minor
patch-label: patch