mirror of
https://github.com/freemkv/freemkv-keysources.git
synced 2026-10-07 18:13:11 +00:00
The Windows UI needs current winsafe, whose real minimum is 1.89 (its manifest under-declares 1.87 while it uses NonNull::from_ref). Rather than stop at the minimum, this goes to current stable and fixes what that costs. The counter-intuitive result: 1.97 is CHEAPER than 1.89. libfreemkv had 54 clippy errors at 1.89 and 6 at 1.97, because clippy tightened the noisy collapsible_if lint in between. Stopping at the minimum would have been the most expensive choice available. Roughly 47 lints across the eight repos, the large majority auto-fixed: libfreemkv 6, freemkv-engine 14, bdemu 8, freemkv-keysources 7, autorip 6, freemkv-unlock 3, freemkv-i18n 3. The hand-fixed ones are a descending sort to sort_by_key(Reverse), four manual checked-division sites, a loop counter replaced by enumerate, and a loop whose first let-else became a while-let. Worth recording for whoever bumps next: clippy is MSRV-AWARE. Those 54 lints only appear once the crate DECLARES 1.89 or later, because let-chains become available. A bare `cargo +1.89 clippy` against a manifest still pinned at 1.87 reports clean and is meaningless — gate with the real precommit script, which is also the only thing that covers build scripts. The pin still sits below the Mac default, so it keeps doing its job: catching lint drift locally before CI sees it.
61 lines
2.2 KiB
YAML
61 lines
2.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Verify Cargo.toml version matches tag
|
|
run: |
|
|
CARGO_VER="v$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')"
|
|
if [ "$CARGO_VER" != "${{ github.ref_name }}" ]; then
|
|
echo "::error::Cargo.toml says $CARGO_VER but tag is ${{ github.ref_name }}"
|
|
exit 1
|
|
fi
|
|
echo "Version match: $CARGO_VER"
|
|
|
|
# Tests run as a PARALLEL TRIPWIRE: they fail the run if they fail, but the
|
|
# release job does NOT `needs:` this job. The tag decision was already gated by
|
|
# the local precommit (same Rust 1.86, same commit).
|
|
#
|
|
# freemkv-keysources is a library — Cargo.lock isn't tracked, so --locked
|
|
# would always fail (no lockfile to lock against on a fresh runner). Its
|
|
# libfreemkv dep resolves from crates.io (the dev .cargo/config.toml patch is
|
|
# gitignored and absent on the runner), so libfreemkv must already be published
|
|
# at this version — the release script enforces that ordering before tagging.
|
|
test:
|
|
needs: verify
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo test
|
|
|
|
# NOTE: the crates.io publish is driven by the maintainer's release tooling
|
|
# from local credentials, not from CI — this repo has no CARGO_REGISTRY_TOKEN
|
|
# secret. release.sh runs `cargo publish --no-verify` locally. CI here only
|
|
# verifies the version/tag match, runs tests (tripwire), and cuts the GitHub
|
|
# Release. The binaries git-tag-pin keysources, so they don't wait on the
|
|
# crates.io publish — it serves external consumers in parallel.
|
|
|
|
release:
|
|
# Only needs `verify`; the GitHub Release is cut as soon as the version
|
|
# check passes, in parallel with the test tripwire.
|
|
needs: verify
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|