Skip to content

chore: Release

chore: Release #2

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
check:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.check-branch.outputs.value }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
- run: git branch -a --contains ${{ github.ref_name }} 2> /dev/null | grep -q ' main' && echo "value=true" >> "$GITHUB_OUTPUT" || exit 0
id: check-branch
publish:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.result == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Make sure crate is ready
run: cargo publish --dry-run
- name: Publish the crate
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}