Skip to content

chore: release

chore: release #3

Workflow file for this run

name: Release
on:
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build-test:
name: Build and test (${{ matrix.toolchain }})
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
release-please:
name: Execute release
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
needs: build-test
outputs:
created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: rust
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@v3
- 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
--no-verify
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}