Skip to content

Update versioning and CI workflows for improved stability and documen… #7

Update versioning and CI workflows for improved stability and documen…

Update versioning and CI workflows for improved stability and documen… #7

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 63, Col: 9): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CARGO_REGISTRY_TOKEN != ''
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
jobs:
validate:
name: Validate Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Ensure tag points to main
run: |
git fetch origin main --depth=1
git merge-base --is-ancestor "${GITHUB_SHA}" origin/main
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Tests
run: cargo test --all-features --all-targets
- name: Docs
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -Dwarnings
- name: Package verification
run: |
cargo package
cargo publish --dry-run
release:
name: GitHub Release
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v6
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: validate
if: ${{ secrets.CARGO_REGISTRY_TOKEN != '' }}
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Publish crate
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish