name: Publish
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
CARGO_TERM_COLOR: always
CACHE_PATHS: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
permissions:
contents: write
jobs:
check:
name: Check
uses: ./.github/workflows/check.yml
test:
name: Test
uses: ./.github/workflows/test.yml
publish:
name: Publish
runs-on: ubuntu-latest
needs: [ check, test ]
steps:
- name: Cache
uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
key: publish-${{ runner.OS }}-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout
uses: actions/checkout@v3
- name: Update Toolchains
run: rustup update
- name: List Local Files
run: tree -a .
- name: Publish Crate
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.API_TOKEN }}