Skip to content

Release

Release #3

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Update version in Cargo.toml
- name: Update version in Cargo.toml
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
# Remove 'v' prefix if present
VERSION=${VERSION#v}
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
# Optional: Verify the update
- name: Verify Cargo.toml update
run: grep "^version = " Cargo.toml
- name: Publish to crates.io
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}