Skip to content

Merge pull request #1 from vitalyvb/classlifetime #3

Merge pull request #1 from vitalyvb/classlifetime

Merge pull request #1 from vitalyvb/classlifetime #3

Workflow file for this run

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 }}