1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Publishes the licenz-core crate to crates.io when a version tag is pushed (e.g. v1.0.0).
# CARGO_REGISTRY_TOKEN must be an API token for a crates.io account with publish rights to licenz-core.
# Create token: https://crates.io/settings/tokens
# GitHub secret: Settings → Secrets and variables → Actions → CARGO_REGISTRY_TOKEN
name: Publish
on:
push:
tags:
- "v*"
concurrency:
group: crates-publish
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run tests (all features)
run: cargo test --all-features
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish