name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
defaults:
run:
shell: bash
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: -Dwarnings
jobs:
test:
uses: ./.github/workflows/ci.yml
publish:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up toolchain
run: rustup show
- name: Release
run: gh release create ${{ github.ref_name }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}