name: Publish a release
on:
workflow_dispatch:
inputs:
level:
description: The kind of release
required: true
type: choice
options: [release, patch, minor, major, alpha, beta, rc]
jobs:
cargo-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure git user
run: |
git config --global user.name github-actions
git config --global user.email actions@users.noreply.github.com
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-release
uses: taiki-e/install-action@main
with:
tool: cargo-release
- name: Create Cargo release
run: cargo release ${{github.event.inputs.level}} --no-confirm --execute
env:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}