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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Post-release automation: version bump, changelog update, MSRV verification
# Self-enforcement: Component 26 (self-enforcement.md)
name: Post-Release
on:
release:
types:
workflow_dispatch:
permissions:
contents: read
jobs:
verify-release:
name: Verify published release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Verify crate published
run: |
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
echo "Released version: $VERSION"
msrv-check:
name: MSRV verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Derive the MSRV from Cargo.toml's declared `rust-version` instead of
# hardcoding it here. A hardcoded `1.80.0` went stale when v3.19.1 raised
# the declared MSRV to 1.95.0 (to match modernized deps), so this job
# checked a 1.95-requiring crate against 1.80 and always failed. Reading
# the value at runtime keeps the verified toolchain in lockstep with the
# crate's actual MSRV — no future drift.
#
# Select the `pmat` package by NAME, not `.packages[0]`: this is a 2-member
# workspace (pmat + pmat-dashboard) and `cargo metadata` does not guarantee
# ordering, so `.packages[0]` was pmat-dashboard (no rust-version → "null",
# which then failed `rustup toolchain install null`). Guard against an empty
# read so a future selector break fails loudly here instead of downstream.
- name: Read declared MSRV from Cargo.toml
id: msrv
run: |
MSRV=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] | select(.name=="pmat") | .rust_version')
echo "Declared MSRV: $MSRV"
if [ -z "$MSRV" ] || [ "$MSRV" = "null" ]; then
echo "::error::Could not read rust-version for package 'pmat' from Cargo.toml"
exit 1
fi
echo "version=$MSRV" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.version }}
components: clippy
# Scope to `-p pmat`: it is pmat's MSRV we derived and are verifying.
# pmat-dashboard declares no rust-version and must not gate this check.
- name: Check MSRV ${{ steps.msrv.outputs.version }} compilation
run: cargo check -p pmat --all-features
- name: Clippy on MSRV
run: cargo clippy -p pmat -- -D warnings