Skip to content

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 ​

ChannelAccount/setupSecret or maintainer inputCurrent status
npmCreate an npm account and reserve/publish clap-compiler, then create the npm GitHub Actions environment with NPM_TOKENGranular publish token, or npm trusted publishing after first publicationWrapper validated locally; unpublished; manual publication workflow is prepared
Open VSXCreate 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_PATOVSX_PAT access tokenUnpublished; account/agreement/token not configured; manual publication workflow is prepared
VS Code MarketplacePublisher bratan-corp and a Trusted Publishing policy for .github/workflows/publish-vscode.yml already existNo PAT; the publish job uses GitHub OIDC with id-token: writePublished through Trusted Publishing
ChocolateyChocolatey community account plus the chocolatey GitHub Actions environment and its CHOCOLATEY_API_KEY secretChocolatey Community Repository API keyAccount/secret are configured; 0.43.0 was pushed through the manual publication workflow and is awaiting moderation
SnapcraftCreate Ubuntu One/Snap Store developer account; register clap-compilerExported Snap Store credentials after validationDraft unvalidated in current Snapcraft tooling
AURCreate an AUR account and add a maintainer SSH public keySeparate AUR SSH private keyDraft 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:

  1. In the repository, open Settings → Environments and create an environment named chocolatey.
  2. Add an environment secret named CHOCOLATEY_API_KEY.
  3. 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.
  4. 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 ​

ChannelRequired action
Homebrew tapCreate public BRATAN-CORP/homebrew-tap; official homebrew-core is a later reviewed PR
Scoop bucketPublic BRATAN-CORP/scoop-clap now serves the validated current wheel-based 0.43.0 manifest
NixpkgsFork NixOS/nixpkgs and open a reviewed PR
wingetA 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
PyPIAlready operational through the tagged release trusted-publishing workflow

Release procedure ​

Releases are maintainer-gated so GitHub release objects keep user authorship:

  1. Merge the release-prep PR that bumps pyproject.toml / src/clap_compiler/__init__.py and finalizes the CHANGELOG.md section.
  2. 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 on main. Never push the tag by hand; gh release create does it server-side. Merging the version-bump PR alone does not fire the pipeline — forgetting this step has silently skipped releases twice.
  3. Immediately create the GitHub release object for that tag with the maintainer account (gh release create vX.Y.Z --verify-tag). The release workflow intentionally refuses to create the release object itself with the machine token, so the first tag-triggered run may fail fast with Create release ... with the maintainer account before pushing the tag; re-run the workflow after step 3 instead of weakening the check.
  4. The release workflow 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.
  5. After the workflow is green, update packaging pins with scripts/update_packaging.py X.Y.Z and refresh the public Scoop bucket.

Publication order ​

  1. Keep PyPI as the canonical artifact source and verify exact hashes for every release.
  2. 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.
  3. 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.
  4. Publish Snap only after the draft builds and installs in current Snapcraft tooling.
  5. 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.