-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
permissions: | ||
contents: read | ||
jobs: | ||
Publish: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rust:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Load cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: publish | ||
- name: Install toml-cli | ||
run: cargo install toml-cli | ||
- name: Extract Cargo.toml Version | ||
run: echo "VERSION=$(toml get -r Cargo.toml package.version)" >> "$GITHUB_ENV" | ||
- name: Check Version | ||
run: [ "${{ format('v{0}', env.CARGO_VERSION) }}" == "${{ github.ref_name }}" ] | ||
- name: Publish | ||
run: cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |