Publish crates on crates.io #8
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: Publish crates on crates.io | |
on: | |
workflow_dispatch: | |
inputs: | |
skf-api-version: | |
description: "skf-api: major/minor/patch or semver or none if not updating derive crate" | |
required: false | |
default: "none" | |
skf-rs-version: | |
description: "skf-rs: major/minor/patch or semver or none if not updating derive crate" | |
required: false | |
default: "none" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set git credentials | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Publish crates | |
uses: kaleidawave/crates-release-gh-action@main | |
id: release | |
with: | |
version: | | |
{ | |
"skf-api": "${{ github.event.inputs.skf-api-version }}", | |
"skf-rs": "${{ github.event.inputs.skf-rs-version }}" | |
} | |
crates-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Push updated Cargo.toml | |
run: | | |
echo '${{ steps.release.outputs.new-versions }}' | jq -r '.[]' | while read -r update; do | |
git tag "release/$update" | |
done | |
git add . | |
git commit -m "Release: ${{ steps.release.outputs.new-versions-description }}" | |
git push --tags origin main |