Skip to content

Publish

Publish #28

Workflow file for this run

name: Publish
on:
workflow_run:
workflows: Rust
branches: master
types: completed
env:
CARGO_TERM_COLOR: always
jobs:
release-please:
name: Execute release chores
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: rust
token: ${{ secrets.GH_PERSONAL_TOKEN }}
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.created
environment: crates.io
steps:
- uses: actions/checkout@v4
- uses: swatinem/rust-cache@v2
- name: Publish
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials
run: >
cargo publish
--verbose
--locked
--token ${{ secrets.CRATES_TOKEN }}