Release #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
release-crate: | |
environment: crates-io | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup git user | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
- name: Install rust toolchain stable | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
target: x86_64-unknown-linux-gnu | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- run: sudo npm install -g standard-version | |
- name: Determine tag and generate release body | |
run: standard-version --infile RELEASE_BODY.md --skip.commit | |
- name: Generate release context | |
id: release_context | |
run: | | |
tag="$(git describe HEAD --abbrev=0)" | |
echo "tag_name=$tag" >>$GITHUB_OUTPUT | |
echo "version=${tag/v/}" >>$GITHUB_OUTPUT | |
git tag -d "${tag}" | |
- name: Install cargo-release | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-release | |
- run: cargo release ${{ steps.release_context.outputs.version }} --execute --no-confirm | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ steps.release_context.outputs.tag_name }} | |
tag_name: ${{ steps.release_context.outputs.tag_name }} | |
body_path: RELEASE_BODY.md |