Skip to content

0.16.0

0.16.0 #20

Workflow file for this run

name: Publish
permissions:
contents: write
attestations: write
pull-requests: write
on:
release:
types:
- published
jobs:
upload_release:
name: Upload release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Include all history and tags, needed for building the right version
with:
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: "stable"
- uses: Swatinem/rust-cache@v2
- name: Publish tag ${{ github.event.release.tag_name }} crate to crates.io
env:
CARGO_REGISTRY_TOKEN: "${{secrets.CRATES_IO_TOKEN}}"
run: |
# Get tag name from event
tag_name="${{ github.event.release.tag_name }}"
if [[ ! "$tag_name" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
cd $(echo $tag_name | rev | cut -d'/' -f2- | rev)
fi
cargo publish --registry crates-io