Package release and deployment automation
Package release and deployment automation moves approved changes from main to public package registries, GitHub Releases, the Homebrew tap, the VS Code Marketplace, and the hosted website. Changesets manages package version proposals and the npm release cycle. Separate workflows publish the website and the editor extension because each has its own release boundary.
The parent page Release and repository automation describes the wider CI and repository controls. Icon contribution automation covers the checks that protect catalog changes before they reach this release path. Editor, launcher, and browser extensions explains how the VS Code extension behaves for users.
Workflow validation
Workflow validation checks GitHub Actions files before a pull request can merge. Actionlint reports workflow syntax and expression errors only when a pull request changes files under .github/workflows/. The check uses a concurrency group for each pull request, so a newer commit replaces an older validation run.
References: .github/…/actionlint.yml• L3-23
Package release lifecycle
The package lifecycle turns changes merged to main into a version proposal, then into built packages and public release records. The proposal and publication steps remain separate so maintainers can review version changes before users receive them.
Changeset version proposals
The version workflow runs after pushes to main. It respects pending Changesets first. When no pending Changeset exists, it checks the latest commit and can create a patch proposal for recognized package or icon changes. Icon changes also account for packages that re-export the icon set. The workflow then opens or updates a version pull request with the chore(release) title and commit message.
Changesets now treats the core icon package and its framework packages as one linked release group. The UI package and its framework packages form a second linked group. Internal package dependencies receive patch updates when needed. Public packages use public registry access. Private packages are not versioned for publication by this configuration.
This diagram shows the review boundary between a merge to main, a version proposal, and a publish event.
flowchart LR
Merge[Change merged to main] --> Detect[Find pending or missing Changeset]
Detect --> Proposal[Create or update version PR]
Proposal --> Review[Maintainer review and merge]
Review --> Publish[Publish package versions]
Publish --> Tags[Create package tags and GitHub release]
References: .github/…/version.yml• L3-23 .github/…/version.yml• L43-107 .github/…/version.yml• L112-120 .changeset/config.json• L3-20
Package publication
The publish workflow starts when a version pull request is merged. A manual run provides recovery for a failed release. The workflow installs the locked workspace, builds the release packages, then publishes each public package that is not already present at its target version. Its GitHub Actions dependencies are pinned to full commit references, which keeps the release job tied to reviewed action versions.
The publish loop reads package identity, version, and privacy from each package manifest. It skips private packages and versions already on npm. For the remaining packages, it creates an archive that resolves workspace dependencies to released versions and sends that archive to npm with public access and provenance. It records failed packages while it continues with the other packages, then fails the job after all publish attempts so partial releases remain visible.
After publication, the workflow creates package tags for versions that exist on npm. It uses the thesvg package tag as the main release identity and combines package lists, changelog sections, and install commands in one GitHub Release. It also creates a separate @thesvg/cli release so the Homebrew workflow can detect the CLI release.
References: .github/…/release.yml• L3-29 .github/…/release.yml• L31-70 .github/…/release.yml• L72-118 .github/…/release.yml• L120-157 .github/…/release.yml• L159-282 .github/release-body-header.md• L1-19 packages/…/package.json• L27-56 packages/…/package.json• L18-46
Website deployment
The website deployment path turns the Next.js site into a static export and serves that export through GitHub Pages. Relevant pushes to main and manual runs can start the path. Documentation-only and selected repository-control changes do not start a site deploy.
Static site build
The site build creates the static out/ directory used by the Pages deploy job. It also generates the public API and library files that external tools use for catalog discovery. The root package.json build command includes icon tones, API data, the feed, LLMs text, Draw.io libraries, and Excalidraw libraries before the Next.js build. Public analytics settings must be present at build time because the site bundle receives them during the build.
The static export is a file artifact rather than a running Next.js server. The build must therefore include every page asset and generated catalog file that the website and external tools need.
References: package.json• L5-11 next.config.ts• L3-9 src/…/generate-api.ts• L1-15 src/…/generate-api.ts• L39-88 .github/…/pages.yml• L59-68
Icon feedback snapshot flow
Icon feedback stats use a separate data refresh path before they reach the static site. A scheduled job reads aggregate icon_feedback counts from PostHog into public/…/icon-stats.json. It sends that file through a pull request so normal CI and site deployment controls still apply.
The refresh keeps the last known good snapshot when a PostHog query fails. When the snapshot changes, automation updates a dedicated branch and reuses its open pull request. A companion workflow enables auto-merge after CI passes. The merge uses a personal token so the resulting main push can start downstream deployment workflows.
This diagram shows how remote feedback becomes a reviewed site input rather than a direct write to main.
flowchart LR
Schedule[Scheduled or manual refresh] --> Query[Read aggregate feedback from PostHog]
Query --> Snapshot[Write static icon stats snapshot]
Snapshot --> PR[Update or open refresh pull request]
PR --> CI[Run normal pull request checks]
CI --> Merge[Auto-merge after checks pass]
Merge --> Deploy[Trigger main-branch site deployment]
References: .github/…/icon-stats-snapshot.yml• L3-36 .github/…/icon-stats-snapshot.yml• L38-52 .github/…/icon-stats-snapshot.yml• L85-129 .github/…/auto-merge-icon-stats-pr.yml• L3-20 .github/…/auto-merge-icon-stats-pr.yml• L22-41 src/…/fetch-icon-stats.ts• L3-24 src/…/fetch-icon-stats.ts• L271-306
Pages deployment
The Pages workflow has an ordered build stage and deploy stage. The build installs the locked workspace, creates the static export, and uploads out/ as a Pages artifact. The deploy stage publishes that artifact to the repository’s GitHub Pages environment. One concurrency group prevents overlapping site deployments from competing with one another.
The site and package releases are independent. A package release can update npm and GitHub without deploying the website. A website change can deploy without changing package versions.
References: .github/…/pages.yml• L3-27 .github/…/pages.yml• L31-48 .github/…/pages.yml• L50-81 .github/…/pages.yml• L83-96
Homebrew tap updates
The Homebrew path keeps the thesvg command available through the project’s tap. It does not publish a new formula from the package workflow. Instead, it reacts to the separate CLI GitHub Release created during the package release cycle.
CLI release trigger
The tap workflow listens for published GitHub Releases and accepts a manual run. Automatic runs continue only for tags that start with @thesvg/cli@. Releases for other workspace packages do not change the formula. A manual run can use a supplied CLI version or read the version from packages/…/package.json.
This tag boundary connects package publication to Homebrew without making the tap depend on the combined release tag. The CLI package exposes the thesvg command and requires Node.js 18 or newer.
References: .github/…/homebrew-tap-update.yml• L3-21 .github/…/release.yml• L271-280 packages/…/package.json• L1-4 packages/…/package.json• L24-48
Formula update
When the tap token is available, the workflow asks the Homebrew bump action to update the thesvg formula in the glincker/thesvg tap. It passes the CLI release tag as the formula source tag. If the token is missing, the workflow records a skip instead of failing the package release.
The formula update is a downstream distribution action. A successful npm publish does not prove that the tap changed because the CLI release tag, tap token, and Homebrew action are separate points in the path.
References: .github/…/homebrew-tap-update.yml• L27-37 .github/…/homebrew-tap-update.yml• L40-62
VS Code publishing
The VS Code workflow publishes the editor integration as its own product. It runs for changes under extensions/vscode/ or through a manual dispatch. It does not wait for the Changesets version pull request because the extension has its own version and Marketplace release boundary.
Marketplace version gate
For a push, the workflow compares the current extension version with the version in the prior commit. It publishes only when that version changes. A first extension addition is skipped so a maintainer can perform the first publication manually. A manual run bypasses the version-change gate and publishes the current version.
The workflow installs the extension’s own locked dependencies and invokes the VS Code publishing tool with the VSCE_PAT secret. The publish step builds the extension through its pre-publish path, so the Marketplace receives the packaged editor entry point rather than the source tree.
References: .github/…/vscode-release.yml• L3-18 .github/…/vscode-release.yml• L22-60 extensions/…/package.json• L1-18 extensions/…/package.json• L61-67
Extension release tags
After a successful Marketplace publication, the workflow creates a vscode@<version> Git tag. This tag records the extension release separately from package tags such as thesvg@<version> and @thesvg/cli@<version>. The separation lets the editor integration change at its own pace while remaining traceable to a source revision.
The extension’s user actions and platform boundary are documented in Editor, launcher, and browser extensions. This page covers only the automation that moves a versioned extension to the Marketplace.
References: .github/…/vscode-release.yml• L62-71 extensions/…/package.json• L36-67
Distribution boundaries
The repository has one source tree but several release consumers. The package workflow serves npm users and GitHub Release readers. The Pages workflow serves website users and static API consumers. The Homebrew workflow serves CLI users. The VS Code workflow serves Marketplace users.
These paths share source data but do not share one release event. A catalog change can require a package rebuild and a website export. An extension version change can require only the Marketplace workflow. A CLI package release can require the Homebrew tap update after its dedicated GitHub Release is published. An icon feedback refresh first enters main through its data-only pull request, then follows the site deployment path.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep both Changesets linked package groups aligned with packages that share release versions or depend on the same package family.
- Keep package privacy,
publishConfig, package names, versions, build outputs, and release eligibility aligned. A private deployment package must not enter the public npm path by accident. - Keep the version PR title and commit prefix aligned with the publish workflow’s merge gate.
- Keep the version workflow’s release-commit skip rule aligned with its
chore(release)commit prefix so versioning does not loop. - Keep package build outputs, package names, versions, tags, and changelog headings aligned because the publish workflow derives them from package metadata.
- Keep the publish loop’s package archive, workspace version resolution, npm access, provenance, and failure reporting aligned when changing package publication.
- Keep the combined release tag and the separate
@thesvg/clitag intact when changing release creation. Homebrew depends on the CLI tag pattern. - Keep release workflow action references pinned to reviewed commit SHAs and keep their version comments accurate when changing the release job.
- Keep static API, feed, library, icon-tone, and LLM text generation with the website build when catalog or site output changes.
- Keep the icon stats snapshot, refresh branch, pull request, auto-merge rule, and token choice aligned so feedback refreshes remain reviewed and can trigger the site deploy.
- Keep build-time
NEXT_PUBLIC_*values available to the Pages job when analytics or other public build settings change. - Keep the VS Code package version as the sole push-based publication signal unless the Marketplace release policy changes.
- Keep the VS Code package entry point, package lock, Marketplace token, and
vscode@<version>tag aligned. - Keep workflow syntax and expressions valid when changing any release or deployment workflow because the Actionlint check gates workflow pull requests.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
A package change reaches main without a pending Changeset and is not covered by auto-generation. | The version PR can omit a package, so its published version and changelog stay unchanged. | Check the recognized package and icon paths when changing package layout or change detection. |
| A package intended only for deployment loses its private boundary, or a public package loses its publish settings. | A deploy-only package can enter npm, or a public package can fail to publish with the required access and provenance. | Keep package privacy and publishConfig aligned with the release policy in each package manifest. |
A version PR does not keep the chore(release) title or is merged in another form. | The publish workflow does not start automatically. | Preserve the version workflow title and use manual dispatch only as a recovery path. |
| A package build or archive does not match its package metadata. | npm publication can be incomplete or a GitHub release can list the wrong package version. | Treat package names, versions, build outputs, and changelog headings as one release contract. |
| One package publish fails while other packages succeed. | The job fails after partial publication, so later retry runs must not duplicate packages or hide the failed package. | Keep already-published checks, per-package failure reporting, and the final failure step aligned. |
The dedicated @thesvg/cli@<version> release is not created. | The CLI can publish to npm while the Homebrew tap remains unchanged. | Keep the CLI release creation step and Homebrew tag filter together. |
| A release workflow uses an unpinned or incorrect action reference. | A release can run with an unreviewed action revision or fail before package publication. | Keep action references pinned to reviewed commit SHAs and validate workflow changes with Actionlint. |
| A website output generator is missing from the root build command. | The deployed site or its external catalog files can contain stale or missing data. | Keep all required site generators in the package.json build script and the Pages artifact boundary. |
NEXT_PUBLIC_POSTHOG_KEY or NEXT_PUBLIC_POSTHOG_HOST is absent during the Pages build. | The deployed site can omit analytics setup without a visible deployment error. | Provide the public build values in the Pages job. |
POSTHOG_PERSONAL_API_KEY is missing or cannot query PostHog. | The icon stats snapshot is not refreshed. | Keep the query secret scoped for read access and preserve the last-known-good snapshot on failure. |
Icon stats are pushed with the default GITHUB_TOKEN, or the refresh branch or pull request changes name. | The auto-merge path can stop at approval, or the refreshed snapshot cannot enter the normal main to Pages flow. | Keep the PAT-backed refresh and the branch, pull request, and auto-merge filters aligned. |
| The VS Code version is unchanged on a push. | Marketplace users do not receive the source change. | Bump the extension version for a release or use manual dispatch for a deliberate republish. |
VSCE_PAT is missing or the extension package entry point is invalid. | The Marketplace publish fails or the installed extension cannot start. | Keep the secret, build output, and main field valid together. |
| A workflow file has an invalid Actionlint error. | The pull request check fails before the release or deployment workflow can merge. | Run the workflow validation path and fix syntax or expression errors before merge. |
Key files
| File | Why to read it |
|---|---|
| .changeset/config.json | Defines the linked package groups and the public versioning policy. |
| .github/…/actionlint.yml | Shows the pull request guard for GitHub Actions workflow files. |
| .github/…/version.yml | Shows how merged changes become Changesets and a reviewed version PR. |
| .github/…/release.yml | Shows package builds, per-package npm publication, pinned release actions, tags, and combined GitHub Releases. |
| .github/release-body-header.md | Defines the shared header used in package release notes. |
| packages/…/package.json | Defines the CLI package identity, command, runtime boundary, and public publish settings. |
| packages/…/package.json | Defines the public MCP package identity, archive contents, command, and npm publish settings. |
| packages/…/package.json | Defines the private Cloudflare Worker package and its deployment-oriented scripts. |
| .github/…/homebrew-tap-update.yml | Shows the CLI release trigger and the downstream tap update. |
| package.json | Defines the website build command and the checks used before deployment. |
| next.config.ts | Defines the static export boundary used by GitHub Pages. |
| src/…/generate-api.ts | Shows the catalog files that the website build exposes to external consumers. |
| .github/…/pages.yml | Shows the static export, artifact upload, and GitHub Pages deployment stages. |
| .github/…/icon-stats-snapshot.yml | Shows the scheduled feedback read, snapshot branch, and reusable refresh pull request. |
| .github/…/auto-merge-icon-stats-pr.yml | Shows the CI-gated merge that lets the snapshot enter the main-branch deployment flow. |
| src/…/fetch-icon-stats.ts | Defines the PostHog-to-static-snapshot data boundary and failure behavior. |
| extensions/…/package.json | Defines the extension version, Marketplace identity, entry point, and build or publish commands. |
| .github/…/vscode-release.yml | Shows the version gate, Marketplace publication, and extension release tag. |