Package publication setup
CLAP's packaging drafts are validated locally where possible, but external publication requires accounts, legal acceptance, and credentials that must not be committed. This guide separates what maintainers can do with GitHub alone from what requires a new account.
Requires a new external account
| Channel | Account/setup | Secret or maintainer input | Current status |
|---|---|---|---|
| npm | Create an npm account and reserve/publish clap-compiler, then create the npm GitHub Actions environment with NPM_TOKEN | Granular publish token, or npm trusted publishing after first publication | Wrapper validated locally; unpublished; manual publication workflow is prepared |
| Open VSX | Create an Eclipse account with the same GitHub username, sign the Open VSX Publisher Agreement, create an access token, then create the openvsx GitHub Actions environment with OVSX_PAT | OVSX_PAT access token | Unpublished; account/agreement/token not configured; manual publication workflow is prepared |
| VS Code Marketplace | Publisher bratan-corp and a Trusted Publishing policy for .github/workflows/publish-vscode.yml already exist | No PAT; the publish job uses GitHub OIDC with id-token: write | Published through Trusted Publishing |
| Chocolatey | Chocolatey community account plus the chocolatey GitHub Actions environment and its CHOCOLATEY_API_KEY secret | Chocolatey Community Repository API key | Account/secret are configured; 0.43.0 was pushed through the manual publication workflow and is awaiting moderation |
| Snapcraft | Create Ubuntu One/Snap Store developer account; register clap-compiler | Exported Snap Store credentials after validation | Draft unvalidated in current Snapcraft tooling |
| AUR | Create an AUR account and add a maintainer SSH public key | Separate AUR SSH private key | Draft Docker-validated; not submitted |
Do not paste credentials into issues, pull requests, documentation, or chat. Store them in the repository or organization secret store only after the corresponding account exists.
Chocolatey GitHub Actions setup
The Chocolatey automation is present on main, and the initial account/environment setup is now configured. Keep this secret-handling procedure for rotation or future maintainers:
- In the repository, open Settings → Environments and create an environment named
chocolatey. - Add an environment secret named
CHOCOLATEY_API_KEY. - Copy the API key from the Chocolatey account into that secret. Do not add it as a normal repository variable and do not put it in a workflow file.
- Optionally add required reviewers to the environment if every public package publication should receive manual approval.
The release workflow runs automatically for every matching version tag. It waits for the PyPI publication and artifact verification, refreshes the Chocolatey wheel URL and SHA-256 from PyPI, and builds the package on windows-latest. If the secret is absent, publication is skipped successfully so releases do not turn red before the account exists. If the secret exists, the job checks whether that exact version already exists and pushes only when it is new. Re-running a completed release does not push the same version twice.
The workflow must be run from a tag matching the project version, for example v0.43.0. A new Chocolatey package version cannot be published by reusing an existing version number.
npm and Open VSX manual publication
publish-npm.yml is a manual backfill workflow for the already validated npm wrapper. It refreshes pins from PyPI, downloads and verifies the exact wheel, builds a .tgz artifact, checks whether the exact version already exists, and publishes through the protected npm environment. Create that environment with an NPM_TOKEN granular publish token only after the npm account exists.
publish-openvsx.yml manually tests and publishes the VS Code extension to Open VSX through the protected openvsx environment. Before creating OVSX_PAT, the maintainer must create an Eclipse account with the same GitHub username, sign the Open VSX Publisher Agreement, and generate an access token. The workflow attempts namespace creation idempotently before publishing; publication still fails loudly if the namespace or credentials are invalid.
VS Code Marketplace trusted publishing
The publisher already has a GitHub Actions Trusted Publishing policy bound to BRATAN-CORP/clap and .github/workflows/publish-vscode.yml. The workflow intentionally does not use a GitHub environment because the policy screenshot shows no environment. It runs only manually or from vscode-v* tags, tests the extension, and publishes with npx @vscode/vsce@4.1.1 publish --oidc --skip-duplicate; no PAT or Marketplace secret is stored in the repository.
GitHub-only distribution work
| Channel | Required action |
|---|---|
| Homebrew tap | Create public BRATAN-CORP/homebrew-tap; official homebrew-core is a later reviewed PR |
| Scoop bucket | Public BRATAN-CORP/scoop-clap now serves the validated current wheel-based 0.43.0 manifest |
| Nixpkgs | Fork NixOS/nixpkgs and open a reviewed PR |
| winget | A legacy portable 0.35.1 submission is already pending in microsoft/winget-pkgs#493908; current releases still need a truthful updated installer/portable artifact and manifest update; the Python wheel is not sufficient |
| PyPI | Already operational through the tagged release trusted-publishing workflow |
Release procedure
Releases are maintainer-gated so GitHub release objects keep user authorship:
- Merge the release-prep PR that bumps
pyproject.toml/src/clap_compiler/__init__.pyand finalizes theCHANGELOG.mdsection. - Create the tag+release with
python3 scripts/tag_release.py— it reads the version from pyproject.toml, extracts the notes verbatim from CHANGELOG.md, and creates (or updates) the GitHub release onmain. Never push the tag by hand;gh release createdoes it server-side. Merging the version-bump PR alone does not fire the pipeline — forgetting this step has silently skipped releases twice. - Immediately create the GitHub release object for that tag with the maintainer account (
gh release create vX.Y.Z --verify-tag). Thereleaseworkflow intentionally refuses to create the release object itself with the machine token, so the first tag-triggered run may fail fast withCreate release ... with the maintainer account before pushing the tag; re-run the workflow after step 3 instead of weakening the check. - The
releaseworkflow then validates the tag/version match, builds dist artifacts, publishes to PyPI through trusted publishing, uploads the same artifacts to the existing GitHub release, appends changelog notes plus SHA-256 hashes, and refreshes Chocolatey packaging. - After the workflow is green, update packaging pins with
scripts/update_packaging.py X.Y.Zand refresh the public Scoop bucket.
Publication order
- Keep PyPI as the canonical artifact source and verify exact hashes for every release.
- Publish low-friction channels first after accounts exist: npm and Homebrew tap. The existing Scoop bucket has been updated to the validated current wheel-based manifest.
- Submit moderated/reviewed channels after their drafts are revalidated against the current release: AUR and Nixpkgs. Chocolatey 0.43.0 is already submitted and awaiting moderation.
- Publish Snap only after the draft builds and installs in current Snapcraft tooling.
- Handle winget only after a real current Windows artifact exists; do not publish a wrapper that misrepresents the Python package as a native installer, and do not treat the legacy 0.35.1 submission as current-release coverage.
Every publication PR or release note must distinguish validated draft behavior from actual availability in the public package repository.