Skip to content

Commit 022d36d

Browse files
committed
ci(tombstones): publish deprecation packages atomically with v0.3.0
Wire tombstones/pypi/ and tombstones/vscode/ into the existing release machinery so v0.3.0 atomically ships: agentops-accelerator (PyPI) + AgentOpsAccelerator.agentops-skills (VSIX) agentops-toolkit (PyPI tombstone) + AgentOpsToolkit.agentops-skills (VSIX tombstone) release.yml (5 new jobs + github-release update): build-pypi-tombstone Resolves version from tombstones/pypi/ pyproject.toml via tomllib, exposes as job output, builds dist, asserts artifact filenames with no hardcoded version pin. publish-tombstone-testpypi Gated AFTER publish-testpypi. verify-tombstone-testpypi Installs agentops-toolkit==<version> from TestPyPI, verifies pip-show Requires lists agentops-accelerator, and imports agentops to prove the redirect works end-to-end. publish-tombstone-pypi Gated AFTER publish-pypi AND verify-tombstone-testpypi — prevents shipping a broken redirect to production. publish-tombstone-vsix Gated AFTER publish-vsix. Substitutes the CHANGELOG date sentinel at publish time and tolerates the 'already exists' case. github-release Now lists tombstone artifacts as conditional downloads. The release notes job only blocks on main pypi+vsix — tombstone failures are recoverable in 0.3.1 and never block the canonical GitHub Release. staging.yml (4 new jobs): Mirrors release.yml on the TestPyPI + pre-release VSIX side. publish-tombstone-vsix-prerelease has NO dependency on build-pypi-tombstone (separate channel) to avoid cross-channel coupling. cut-release.yml: 'Sync plugin versions' step now rewrites: tombstones/pypi/pyproject.toml version field (regex) tombstones/vscode/package.json version field (jq) tombstones/vscode/CHANGELOG.md single entry's version heading, preserving YYYY-MM-DD sentinel for publish-time substitution Both Python rewrites use the heredoc-with-env-injection pattern and guard against silent no-op via 'raise SystemExit' if the regex doesn't match. 'git add' and PR body updated accordingly. Required PyPI Trusted Publisher setup is now documented in the docstrings of both release.yml and staging.yml — four total Trusted Publishers are needed (agentops-accelerator and agentops-toolkit, on PyPI and TestPyPI). VSCE_PAT must have 'Marketplace: Manage' scope on the AzDO account that owns BOTH the AgentOpsAccelerator and AgentOpsToolkit publishers; verify with: vsce ls-publishers -p $VSCE_PAT. Reviewed by ai-starter-pack:critic (correctness lens) — all 3 CRITICAL, 4 IMPORTANT, and 1 SUGGESTION findings resolved before commit.
1 parent 2f128d9 commit 022d36d

3 files changed

Lines changed: 537 additions & 12 deletions

File tree

.github/workflows/cut-release.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,53 @@ jobs:
113113
echo "$mp → $VERSION"
114114
done
115115
116+
# tombstones/vscode/package.json (legacy publisher VSIX tombstone)
117+
jq --arg v "$VERSION" '.version = $v' \
118+
tombstones/vscode/package.json > tombstones/vscode/package.json.tmp
119+
mv tombstones/vscode/package.json.tmp tombstones/vscode/package.json
120+
echo "tombstones/vscode/package.json → $VERSION"
121+
122+
# tombstones/pypi/pyproject.toml (legacy distribution PyPI tombstone)
123+
VERSION="$VERSION" python - <<'PY'
124+
import os, re, pathlib
125+
v = os.environ["VERSION"]
126+
p = pathlib.Path("tombstones/pypi/pyproject.toml")
127+
t = p.read_text(encoding="utf-8")
128+
new_t = re.sub(r'^version = "[^"]+"', f'version = "{v}"', t, count=1, flags=re.MULTILINE)
129+
if new_t == t:
130+
raise SystemExit("::error::tombstones/pypi/pyproject.toml version was not updated; check the regex anchor.")
131+
p.write_text(new_t, encoding="utf-8")
132+
PY
133+
echo "tombstones/pypi/pyproject.toml → $VERSION"
134+
135+
# tombstones/vscode/CHANGELOG.md (rewrite single entry's version, preserve YYYY-MM-DD sentinel for publish-time substitution)
136+
VERSION="$VERSION" python - <<'PY'
137+
import os, re, pathlib
138+
v = os.environ["VERSION"]
139+
p = pathlib.Path("tombstones/vscode/CHANGELOG.md")
140+
text = p.read_text(encoding="utf-8")
141+
new_text = re.sub(
142+
r"^## \[\d+\.\d+\.\d+\] - (?:YYYY-MM-DD|\d{4}-\d{2}-\d{2})",
143+
f"## [{v}] - YYYY-MM-DD",
144+
text, count=1, flags=re.MULTILINE,
145+
)
146+
if new_text == text:
147+
raise SystemExit("::error::tombstones/vscode/CHANGELOG.md heading was not updated; check the regex anchor.")
148+
p.write_text(new_text, encoding="utf-8")
149+
PY
150+
echo "tombstones/vscode/CHANGELOG.md → [$VERSION] (date sentinel preserved)"
151+
116152
- name: Configure git
117153
run: |
118154
git config user.name "github-actions[bot]"
119155
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
120156
121157
- name: Commit and push
122158
run: |
123-
git add CHANGELOG.md plugins/agentops/package.json plugins/agentops/plugin.json .github/plugin/marketplace.json .claude-plugin/marketplace.json
159+
git add CHANGELOG.md plugins/agentops/package.json plugins/agentops/plugin.json \
160+
.github/plugin/marketplace.json .claude-plugin/marketplace.json \
161+
tombstones/vscode/package.json tombstones/pypi/pyproject.toml \
162+
tombstones/vscode/CHANGELOG.md
124163
git commit -m "chore: prepare release ${{ env.version }}"
125164
git push origin "release/v${{ env.version }}"
126165
@@ -140,7 +179,9 @@ jobs:
140179
- Branch \`release/v${{ env.version }}\` created from \`develop\`
141180
- \`CHANGELOG.md\` updated: versioned section \`[${{ env.version }}]\` added
142181
- Plugin versions synced to \`${{ env.version }}\` (package.json, plugin.json, marketplace.json)
143-
- Staging pipeline triggered automatically (build → TestPyPI + VSIX pre-release → verify)
182+
- Tombstone versions synced to \`${{ env.version }}\` (tombstones/vscode/package.json, tombstones/pypi/pyproject.toml)
183+
- \`tombstones/vscode/CHANGELOG.md\` heading rewritten to \`[${{ env.version }}]\` (date sentinel left for publish-time substitution)
184+
- Staging pipeline triggered automatically (build → TestPyPI + VSIX pre-release → verify, plus tombstone TestPyPI + VSIX pre-release)
144185
145186
### Next steps
146187
1. Wait for the **Staging** pipeline to pass

0 commit comments

Comments
 (0)