mirror of
https://github.com/rust-vmm/rust-vmm-ci.git
synced 2026-08-05 03:08:31 +00:00
Add a github action sample workflow file for auto-publishing crates on creation of 'v*' tags. The sample workflow assumes a non-workspace setup, so that cargo publish can be run from the repository root (= crate root). For multi-crate repositories, repository_setup.sh will generate derivatives of this file. There is a useless `cd .` in the `run` step which only exists so that sed can easily replace it with the path for crates in a workspace when auto-generating workflows. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
22 lines
506 B
YAML
22 lines
506 B
YAML
name: Publish to crates.io
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*'] # Triggers when pushing version tags
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
# environment: release # Optional: for enhanced security
|
|
permissions:
|
|
id-token: write # Required for OIDC token exchange
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: rust-lang/crates-io-auth-action@v1
|
|
id: auth
|
|
- run: |
|
|
cd .
|
|
cargo publish
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|