Publish a release
For the repository maintainer. If you only want to use the extension, install it from the Marketplace or the .vsix as described in Set up your computer.
One-time setup, then every release is a merged release-please PR.
One-time
- VS Marketplace: sign in at https://marketplace.visualstudio.com/manage, create the publisher (
publisherinpackage.json). Create an Azure DevOps personal access token at https://dev.azure.com (User settings → Personal access tokens → New Token; Organization "All accessible organizations", scope Marketplace → Manage) and store it as theVSCE_PATsecret in thereleaseenvironment. Trusted publishing (vsce publish --oidc) is not yet shipped in any released vsce; switch back once it is. - Open VSX: create an Eclipse account with the same GitHub username, sign in to https://open-vsx.org, sign the publisher agreement, generate an access token →
OVSX_PATsecret in thereleaseenvironment, thennpx ovsx create-namespace <publisher> -p $OVSX_PAT. - GitHub: create an environment named
releasethat requires your approval; protectmain.
Branch protection
.github/CODEOWNERS assigns every path to @realslimslaney. It only bites once a ruleset requires code-owner review, and that ruleset also blocks a solo maintainer from merging their own PRs unless they are on the bypass list. Enable it when the first outside contributor shows up:
gh api -X POST repos/realslimslaney/pdf-case-review/rulesets --input - <<'JSON'
{
"name": "main",
"target": "branch",
"enforcement": "active",
"conditions": { "ref_name": { "include": ["refs/heads/main"], "exclude": [] } },
"bypass_actors": [{ "actor_id": 5, "actor_type": "RepositoryRole", "bypass_mode": "always" }],
"rules": [
{ "type": "deletion" },
{ "type": "non_fast_forward" },
{ "type": "pull_request", "parameters": {
"required_approving_review_count": 1,
"require_code_owner_review": true,
"dismiss_stale_reviews_on_push": true,
"require_last_push_approval": false,
"required_review_thread_resolution": true } },
{ "type": "required_status_checks", "parameters": {
"strict_required_status_checks_policy": true,
"required_status_checks": [{ "context": "check (ubuntu-latest)" }] } }
]
}
JSONactor_id: 5 is the repository Admin role. Without that entry a sole maintainer who is also the only code owner could never merge, because the rule requires a code-owner review from someone else. The ruleset itself can only be created or changed by an admin.
Every release
- Merge Conventional-Commit PRs into
main. - release-please keeps a "chore: release X.Y.Z" PR up to date; merge it to tag
vX.Y.Zand create the GitHub release. - Start the
Releaseworkflow by hand: Actions, Release, "Run workflow", and pick the tagvX.Y.Zas the ref (orgh workflow run release.yml --ref vX.Y.Z). The tag does not start it on its own, because release-please creates the tag with the workflow's ownGITHUB_TOKEN, and GitHub never starts workflows from events made by that token. - The workflow builds the VSIX, attaches it to the release, and then waits on the
releaseenvironment. Approve the deployment under the run's "Review deployments" button; both marketplace publish jobs run after that. Odd minor versions go to the pre-release channel automatically. - If the Marketplace job fails after all five attempts with
Request timeout: /_apis/gallery, follow Upload a release by hand. Open VSX will already have the version.
To make step 3 automatic, give release-please a token other than GITHUB_TOKEN (a fine-grained personal access token or a GitHub App installation token with contents and pull-requests write) and pass it as token: in release-please.yml; tags pushed with that token do trigger the Release workflow.
Local dry run: pnpm package && pnpm exec vsce ls and install the .vsix into a clean profile (code --profile temp --install-extension pdf-case-review-*.vsix).