Merge pull request #1 from vitalyvb/classlifetime #3
Workflow file for this run
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
on: | |
push: | |
tags: | |
- "v0.[0-9]+.[0-9]+" | |
workflow_dispatch: | |
name: Publish release tag to crates.io | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check package version | |
run: | | |
cat Cargo.toml | gawk -v ver="$GITHUB_REF_NAME" -F= 'BEGIN {res=1;p=0} /^\[/ {p=0} /^\[package\]/ {p=1} /^version/ {if (p) {gsub(/[" ]/,"", $2); fver="v"$2; if (fver==ver) {res=0}}} END {exit res}' | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
with: | |
targets: x86_64-unknown-linux-gnu | |
- run: cargo +${{steps.toolchain.outputs.name}} publish --target x86_64-unknown-linux-gnu | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |