Skip to content

Build packages into a draft release, and publish them when it's published - #46

Merged
chdsbd merged 5 commits into
masterfrom
claude/formatting-cli-extension-option-zpeww8
Nov 10, 2026
Merged

chdsbd merged 5 commits into
masterfrom
claude/formatting-cli-extension-option-zpeww8

Conversation

@chdsbd

@chdsbd chdsbd commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

🤖 When master has a version with no release yet, GitHub Actions builds a VSIX package for each platform and drafts a release with them. Publishing the draft publishes exactly those packages to the Marketplace.

Drafting (draft-release.yml, on pushes to master)

  1. version: reads the version from package.json. It stops if the v<version> tag already exists, or if a release (draft or published) already uses it. That covers pushes without a version bump and reruns. v5.2.0 is already published, so merging this PR creates nothing.
  2. build (contents: read, so npm ci runs without write access): s/package-all downloads each platform's gh-codeowners and runs vsce package --target for 8 platforms plus the universal package, then checks they're all there.
  3. draft (contents: write): creates a draft v<version> on the pushed commit with all the packages attached and the version's CHANGELOG.md section as notes (s/release-notes, the same script as gh-codeowners). Then it reads back the draft's assets.

A concurrency group keeps two quick pushes from both drafting.

Making sure every package is there

s/packages is the only list of what a release needs: 9 packages, named like github-code-owners-5.3.0-darwin-arm64.vsix. s/check-packages fails unless a set of files or asset names matches it exactly, nothing missing and nothing extra. It runs:

  • after building, before anything is uploaded;
  • on the draft's actual assets after gh release create. If that fails, or the upload fails partway, the workflow deletes the draft, so a draft only ever exists with every package. Deleting it also lets the next push or a re-run try again.
  • in publish.yml, on the published release's assets before anything goes to the Marketplace. A release you published without them, like one created by hand, fails here with nothing published.

Publishing (publish.yml, on release published)

Downloads the release's .vsix files, checks them, and runs vsce publish --oidc --packagePath dist/*.vsix in a single job. It no longer rebuilds or re-downloads gh-codeowners, so the Marketplace gets the same files that are attached to the release.

Publishing the draft stays manual, because a release published with GITHUB_TOKEN wouldn't trigger publish.yml, and the tag ruleset only lets admins create v* tags.

Verification

  • s/package-all 5.2.0 built all 9 packages locally, with s/download-server stubbed to copy a local gh-codeowners binary, since gh release download is blocked in my environment. Each platform's manifest has its TargetPlatform and a bin/ binary; the universal package has neither.
  • s/check-packages passes for the full set and for bare asset names, and fails, showing the difference, for a missing package or an extra file.
  • I ran the draft step's script with a stub gh: it succeeds with every package; if gh release create fails or the draft is missing a package, it deletes the draft and fails.
  • upload-artifact v7.0.2 and download-artifact v8.0.2 are pinned to the commits their tags point to.
  • Neither workflow has run on GitHub yet. The first draft and publish will be the next version bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_018s9fHcEQxmXZ7pQ6v9W2KM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s9fHcEQxmXZ7pQ6v9W2KM
The draft's notes are the version's CHANGELOG.md section. Publishing it
creates the tag and runs publish.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s9fHcEQxmXZ7pQ6v9W2KM
Use its s/release-notes, skip versions that already have a tag, don't let
two pushes draft at once, and document releasing in CONTRIBUTING.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s9fHcEQxmXZ7pQ6v9W2KM
draft-release.yml builds a VSIX package for each platform and only drafts
the release once s/check-packages finds all of them attached, deleting a
draft that's missing any. publish.yml publishes the release's packages to
the Marketplace, after checking they're all there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018s9fHcEQxmXZ7pQ6v9W2KM
@chdsbd chdsbd changed the title Draft a release when master has a new version Build packages into a draft release, and publish them when it's published Nov 10, 2026
@chdsbd
chdsbd marked this pull request as ready for review November 10, 2026 13:40
@chdsbd
chdsbd merged commit 7f47c2c into master Nov 10, 2026
8 checks passed
@chdsbd
chdsbd deleted the claude/formatting-cli-extension-option-zpeww8 branch November 10, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants