Skip to content

Commit

Permalink
publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
jofas committed Apr 22, 2023
1 parent c9de269 commit b42f7c5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
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 }}

0 comments on commit b42f7c5

Please sign in to comment.