Publish crates on crates.io #5
This file contains hidden or 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: Publish crates on crates.io | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "major/minor/patch or semver" | |
| required: false | |
| default: patch | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| # For `git push`ing the updated `Cargo.toml` | |
| contents: write | |
| steps: | |
| - id: checkout | |
| uses: actions/checkout@v4 | |
| - id: auth | |
| uses: rust-lang/crates-io-auth-action@v1 | |
| - name: Crates publish | |
| uses: kaleidawave/crates-release-gh-action@improvements | |
| id: release | |
| with: | |
| version: ${{ github.event.inputs.version }} | |
| crates-token: ${{ steps.auth.outputs.token }} | |
| - name: Push updated Cargo.toml | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -u | |
| git commit -m "Release: ${{ steps.release.outputs.new-versions-description }}" | |
| echo '${{ steps.release.outputs.new-versions }}' | jq -r '.[]' | while read -r update; do | |
| git tag "release/$update" | |
| done | |
| git push --tags origin ${{ steps.checkout.outputs.ref }} |