Skip to content
Xerobi Icons

Publishing

Every release publishes to six places. The one-time manual first publish that npm and pub.dev need before automation works, and the order that works.

Last updated

Every release publishes to six places. Each registry only lets you switch on automated publishing for a package that already exists, so the very first publish of each one is done by hand. After that, publishing a GitHub release does it all.

Target Registry First publish (by hand, once) Automation after that Guide
@xerobi/icons-core, -react, -react-native, -vue, -web, -font npm node scripts/first-publish.mjs npm --yes Trusted publishing (OIDC) + provenance npm
xerobi_icons pub.dev node scripts/first-publish.mjs pub --yes Automated publishing (OIDC) from a GitHub release pub.dev
Android / Compose JitPack (from the git tag) Look the tag up once on jitpack.io The release workflow asks JitPack to build Android
Swift package Git tag (no registry) Nothing to publish; the tag is the release The release workflow builds it as a check Swift
Figma plugin Figma Community Submit once in the Figma app, wait for review Zip attached to each release; new versions are still submitted by hand (no Figma API) Figma
Website Cloudflare Pages Create the project once Deploy workflow on every push to main website

The order that works

Do these in order the first time. Section numbers refer to the guides.

  1. Accounts and names (nothing is published yet; this is where surprises happen)
    • npm: create the xerobi organization, enable 2FA (npm §1). Check the six names are free (§2).
    • pub.dev: sign in with the Google account that will own xerobi_icons (pub.dev §1).
    • GitHub: the repository must be public and named xerobi/xerobi-icons (JitPack, Swift Package Manager and the OIDC publishers all key on that path). If it is elsewhere, search the docs for xerobi/xerobi-icons and change it.
  2. Website (website): create the Pages project and add the secrets. Do this first because the Figma plugin reads the live site, and every page links to package READMEs that quote the site URL.
  3. Version and build: confirm version in the root package.json (this is the version of the first release), then
    cd tooling/generator && uv sync && bun run build:all && bun run test
    Commit the regenerated packages/ and Package.swift, merge to main.
  4. First publish by hand, from a clean checkout of main:
    node scripts/first-publish.mjs npm           # dry run: sizes and problems
    node scripts/first-publish.mjs npm --yes     # needs `npm login`
    node scripts/first-publish.mjs pub --yes     # needs a Google sign-in
  5. Switch on automation for each registry: npm Trusted Publisher for all six packages, pub.dev automated publishing, repository variable PUB_AUTOMATED=true (npm §4, pub.dev §3).
  6. Create the GitHub release for the same version:
    gh release create v0.1.0 --target main --title "Xerobi Icons v0.1.0" --generate-notes
    The workflow runs, finds npm and pub.dev already at that version and skips them (this is on purpose), attaches the Figma zip, triggers JitPack and checks Swift. This proves the pipeline end to end without publishing anything twice.
  7. Submit the Figma plugin (Figma).
  8. The next release (0.1.1) is the first fully automatic one: bump, build, commit, merge, gh release create. Nothing else.

Prefer to hold the first manual publish at an earlier number? Publish 0.1.0 by hand, and make the first automated release 0.4.4; that is exactly what step 8 describes.

Every later release

  1. Branch release/vX.Y.Z. Bump version and released in the root package.json; add the changelog entry in tooling/generator/scripts/packages.py.
  2. cd tooling/generator && bun run build:all && bun run test. Commit everything it changes under packages/ and Package.swift (Swift and Android are read straight from the tag, so they must be in git).
  3. Open the PR. CI rebuilds and fails if the committed packages are stale (it checks branches named release/*).
  4. Merge, then gh release create vX.Y.Z --target main --generate-notes.
  5. Watch Actions → Release. Then submit the Figma zip.

Semver: new icons are a minor; redraws and fixes a patch; removing an icon, an alias, or a prop is a major.

What runs when

Event Workflow Does
Pull request ci.yml lint, audit, build, tests, Android/Flutter/Swift builds; release branches also check generated files
Push to main touching the site or icons deploy-web.yml build the site and deploy to Cloudflare Pages
lastmod.json changes on main indexnow.yml tell search engines which pages changed
GitHub release published release.yml verify tag, build, publish npm, pub.dev, attach Figma zip, trigger JitPack, build Swift

Secrets and variables

Name Kind Used for
CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID secrets website deploy
SITE_URL variable public origin of the website (default https://icons.xerobi.com)
PUB_AUTOMATED variable, true enables the pub.dev job once automated publishing is switched on
NPM_TOKEN secret, optional npm publish fallback; not needed once Trusted Publishers are set
FIGMA_PLUGIN_ID variable, optional written into the Figma manifest when building the zip

When something fails

Symptom Fix
Release workflow stops at verify The tag is not on main, or does not equal v + root package.json version. Delete the release and tag, fix, recreate
build fails on “Generated packages are committed and current” You changed icons or scripts without committing regenerated output: run bun run build:all, commit, move the tag (git tag -f, git push -f origin vX.Y.Z), re-run
npm job: E404 / E403 on publish The package does not exist yet (do the first publish), or the Trusted Publisher is missing or has the wrong workflow filename
npm job: ENEEDAUTH Trusted Publisher is not configured for that package, and there is no NPM_TOKEN
One npm package failed, five succeeded Re-run the failed job: it skips what is already published
pub.dev job: “not authorized” Automated publishing is not enabled, the tag pattern is not v{{version}}, or the run was workflow_dispatch (use a real release)
JitPack never turns green Open https://jitpack.io/#xerobi/xerobi-icons, click the tag’s Log; it builds packages/android with JDK 17 per jitpack.yml
Wrong version published npm: npm deprecate [email protected] "reason" (unpublish is limited to 72 hours and breaks installs); pub.dev: you can only retract; ship a patch