|
1
|
name: Release Preflight |
|
2
|
|
|
3
|
# Shared release gate, called by every release-sdk-*.yml before it allocates an |
|
4
|
# expensive runner, and by ci.yml on ordinary pushes. |
|
5
|
# |
|
6
|
# It replaces five partial copies of "does the tag match my version file?" — |
|
7
|
# each release workflow used to check only its own manifest, which is why |
|
8
|
# sdk/react-native/package-lock.json drifted four releases (stuck at 1.1.2 while |
|
9
|
# package.json read 1.2.1) without a single job failing. |
|
10
|
# |
|
11
|
# Runs on ubuntu in well under a minute. The 1.2.0 crates.io failure took 13m12s |
|
12
|
# of queued macOS runner to surface a manifest error that `make lint-publish` |
|
13
|
# proves instantly. |
|
14
|
|
|
15
|
on: |
|
16
|
workflow_call: |
|
17
|
inputs: |
|
18
|
tag: |
|
19
|
description: "Tag to validate against the release version. Empty skips that check." |
|
20
|
type: string |
|
21
|
required: false |
|
22
|
default: "" |
|
23
|
|
|
24
|
permissions: |
|
25
|
contents: read |
|
26
|
|
|
27
|
jobs: |
|
28
|
preflight: |
|
29
|
name: Validate release metadata |
|
30
|
runs-on: ubuntu-latest |
|
31
|
|
|
32
|
steps: |
|
33
|
- name: Checkout |
|
34
|
uses: actions/checkout@v6 |
|
35
|
|
|
36
|
# Every version source (5 manifests, 2 npm JSON files, 3 Cargo.lock files) |
|
37
|
# must agree with Cargo.toml, and both CHANGELOGs must have a real section. |
|
38
|
- name: Version sources agree |
|
39
|
run: make verify |
|
40
|
|
|
41
|
# cargo publish rejects git dependencies outright. Cargo.toml documents |
|
42
|
# pointing the mistralrs deps back at the fork for local work, so this is |
|
43
|
# checked at release time rather than on every edit. |
|
44
|
- name: Cargo.toml is publishable to crates.io |
|
45
|
run: make lint-publish |
|
46
|
|
|
47
|
- name: Tag matches the release version |
|
48
|
if: inputs.tag != '' |
|
49
|
env: |
|
50
|
TAG: ${{ inputs.tag }} |
|
51
|
run: | |
|
52
|
VERSION="$(python3 scripts/sync-release-version.py --print)" |
|
53
|
echo "Tag: $TAG" |
|
54
|
echo "Version: $VERSION" |
|
55
|
if [ "$TAG" != "$VERSION" ]; then |
|
56
|
echo "::error::Tag '$TAG' does not match the release version '$VERSION'." |
|
57
|
echo "::error::Tags are bare semver — a 'v' prefix will not match the release trigger." |
|
58
|
exit 1 |
|
59
|
fi |