You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(release): keep every registry and manifest on one version
SharpeArena publishes to crates.io, npm and PyPI from manifests that nothing rewrote,
so the next bump would have drifted: the publish step reads a stale version, finds it
already on the registry, and skips - green run, nothing shipped. That is how the
sibling repo's npm package stalled two releases behind.
Rewrites five version sites from the workspace version (including the pyo3 crate that
is excluded from the workspace, and the Python __version__ that had already gone
stale), asserts manifests match the tag before publishing, and verifies all three
registries serve the release afterwards.
# cargo-release rewrites this manifest from the workspace version (the rules live in
79
+
# crates/sharpearena/release.toml), so it must already equal the tag. If it does not,
80
+
# the publish step below reads a stale version, finds it already on the registry, and
81
+
# "skips" - a green run that shipped nothing. That is exactly how the sibling repo's
82
+
# npm package stalled at 0.0.10 while its crates went to 0.0.11.
83
+
- name: Assert the npm manifest matches the release tag
84
+
if: startsWith(github.ref, 'refs/tags/v')
85
+
working-directory: npm/sharpearena
86
+
run: |
87
+
TAG="${GITHUB_REF_NAME#v}"
88
+
V=$(node -p "require('./package.json').version")
89
+
if [ "$V" != "$TAG" ]; then
90
+
echo "::error file=npm/sharpearena/package.json::version $V does not match tag $TAG - the manifest is stale, cut the release with 'cargo release' so pre-release-replacements rewrite it"
91
+
exit 1
92
+
fi
93
+
echo "ok npm manifest is at $V"
94
+
78
95
- name: Publish (skip if version exists)
79
96
working-directory: npm/sharpearena
80
97
run: |
@@ -94,6 +111,25 @@ jobs:
94
111
environment: pypi
95
112
steps:
96
113
- uses: actions/checkout@v6
114
+
115
+
# Same stale-manifest trap as the npm job: `skip-existing: true` below turns an
116
+
# already-published version into a silent no-op, so a pyproject.toml left behind by
117
+
# a hand-edited bump would ship nothing and still report green. crates/sharpearena-py
118
+
# is excluded from the Cargo workspace, so only pre-release-replacements move it.
119
+
- name: Assert the Python manifest matches the release tag
120
+
if: startsWith(github.ref, 'refs/tags/v')
121
+
run: |
122
+
TAG="${GITHUB_REF_NAME#v}"
123
+
fail=0
124
+
for f in crates/sharpearena-py/pyproject.toml crates/sharpearena-py/Cargo.toml; do
125
+
V=$(grep -m1 -E '^version = "' "$f" | sed 's/.*"\(.*\)".*/\1/')
126
+
if [ "$V" != "$TAG" ]; then
127
+
echo "::error file=$f::version $V does not match tag $TAG - the manifest is stale, cut the release with 'cargo release' so pre-release-replacements rewrite it"
128
+
fail=1
129
+
fi
130
+
done
131
+
exit $fail
132
+
97
133
- name: Build manylinux wheels + sdist
98
134
uses: PyO3/maturin-action@v1
99
135
with:
@@ -114,3 +150,60 @@ jobs:
114
150
# Idempotent re-runs: a version already on PyPI is skipped, not an error
115
151
# (matches the crates + npm skip-if-published guards in this workflow).
116
152
skip-existing: true
153
+
154
+
# Every publish step above is skip-if-present, which makes re-runs idempotent but also
155
+
# lets a surface that shipped nothing still report green. This job asks the three
156
+
# registries directly, so an incomplete release fails the run instead of passing quietly.
0 commit comments