Skip to content

v0.5.3

v0.5.3 #13

Workflow file for this run

name: Publish crate
on:
release:
types: [published]
jobs:
static-analysis:
strategy:
matrix:
rust: [stable, nightly]
runs-on:
- windows-2019
- windows-2022
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update toolchain
run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} && rustup component add clippy
- name: Run cargo static analysis checks
run: |
cargo check
cargo clippy --all-targets --all-features -- -D clippy::all
cargo test
publish:
needs: static-analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update toolchain
run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} && rustup component add clippy
- name: Sanity check tag equals crate version
run: |
pkg_version=$(awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2); exit; }' Cargo.toml)
if [[ "${{ github.ref_name }}" = "$pkg_version" ]]; then
echo "Github ref ${{ github.ref_name }} equals from parsed package version $pkg_version. Continuing..."
else
echo "Github ref ${{ github.ref_name }} differs from parsed package version $pkg_version! Aborting..."
exit 1
fi
- name: Publish to crates.io
run: |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}