| 1 |
name: Release Rust Crate |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- "v*" |
| 7 |
workflow_dispatch: |
| 8 |
inputs: |
| 9 |
version: |
| 10 |
description: The version to build |
| 11 |
|
| 12 |
jobs: |
| 13 |
release: |
| 14 |
permissions: |
| 15 |
id-token: write |
| 16 |
|
| 17 |
runs-on: ubuntu-latest |
| 18 |
environment: release |
| 19 |
steps: |
| 20 |
- uses: actions/checkout@v5 |
| 21 |
with: |
| 22 |
|
| 23 |
ref: ${{ github.event.inputs.version || github.ref }} |
| 24 |
persist-credentials: false |
| 25 |
|
| 26 |
- uses: rust-lang/crates-io-auth-action@v1 |
| 27 |
id: auth |
| 28 |
|
| 29 |
- name: Publish to crates.io |
| 30 |
run: cargo publish |
| 31 |
env: |
| 32 |
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |