@theholocron/astromech 5.0.0-alpha.471 → 5.0.0-alpha.472
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.mjs +82 -14
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -253,6 +253,15 @@ job after the release job (opt in with `deploy-on-release: true`), so a deploy
|
|
|
253
253
|
is its own re-runnable check. A `deploy` task with `on: "release"`
|
|
254
254
|
generates no workflow.
|
|
255
255
|
|
|
256
|
+
Each package is compared from the commit it was last deployed at, not only from
|
|
257
|
+
`from`: a successful deploy moves a `deployed/<package>` tag
|
|
258
|
+
(`@theholocron/sentinel` is `deployed/theholocron-sentinel`) to the release
|
|
259
|
+
commit and pushes it, so a release whose deploy job failed is made up by the next
|
|
260
|
+
release, even one that touches nothing in the app. A package with no tag yet (or
|
|
261
|
+
one whose tag is not an ancestor of `to`) falls back to `from`, and its skip line
|
|
262
|
+
says `No deploy is recorded for it yet.` A tag that cannot be pushed is a warning,
|
|
263
|
+
not a failed deploy. A dry run writes no tag.
|
|
264
|
+
|
|
256
265
|
## Development
|
|
257
266
|
|
|
258
267
|
| Script | Description |
|
package/dist/index.mjs
CHANGED
|
@@ -69,7 +69,7 @@ var preview_specs_default$1 = "#\n# Makes the forum post for a spec or ADR while
|
|
|
69
69
|
var preview_default$1 = "name: Preview\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n type:\n description: \"Type of deployment: docs or storybook\"\n required: true\n type: string\n name:\n description: Repo name prefix used to filter the docs site package (<name>-site); omit to run pnpm -C docs build\n required: false\n type: string\n default: \"\"\n storybook-projects:\n description: >\n JSON array of { \"name\"?, \"workingDir\", \"outputDir\"? } objects for storybook deploys.\n Each is built via `pnpm -C <workingDir> build:storybook`. If \"name\" is provided the\n output is placed under `sandbox/<name>/`; omit \"name\" for single-repo deploys and the\n output lands directly in `sandbox/`.\n type: string\n required: false\n default: \"[]\"\n build-script:\n description: pnpm script that builds the Storybook static output (single storybook, type:storybook only)\n type: string\n required: false\n default: build:storybook\n output-dir:\n description: Directory where Storybook writes its static output (single storybook, type:storybook only)\n type: string\n required: false\n default: storybook-static\n cloudflare-project:\n description: >\n Cloudflare Pages project name. Falls back to the CLOUDFLARE_PAGES_PROJECT\n org variable (filled from the 1Password sync) when omitted — set that variable once and all repos get previews\n without per-repo config.\n required: false\n type: string\n default: \"\"\n\njobs:\n deploy-preview:\n name: Preview\n if: ${{ github.event.action != 'closed' }}\n runs-on: ubuntu-latest\n permissions:\n contents: read\n deployments: write\n pull-requests: write\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Build workspace dependencies\n # The docs site imports workspace packages (e.g. a shared theme) via\n # `workspace:*` — its exports map points at dist/, which doesn't\n # exist until something builds it. Nothing else in this job does,\n # so without this step Vite fails to resolve the import entirely.\n if: ${{ inputs.type == 'docs' }}\n run: pnpm run build\n\n - name: Build docs site\n if: ${{ inputs.type == 'docs' && inputs.name != '' }}\n env:\n SITE_NAME: ${{ inputs.name }}\n run: pnpm --filter @theholocron/\"$SITE_NAME\"-site build\n\n - name: Build docs site\n if: ${{ inputs.type == 'docs' && inputs.name == '' }}\n run: pnpm -C docs build\n\n - name: Build Storybook projects\n if: ${{ inputs.storybook-projects != '[]' }}\n env:\n PROJECTS: ${{ inputs.storybook-projects }}\n run: |\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n pnpm -C \"$workingDir\" build:storybook\n done\n\n - name: Build Storybook\n if: ${{ inputs.type == 'storybook' && inputs.storybook-projects == '[]' }}\n env:\n BUILD_SCRIPT: ${{ inputs.build-script }}\n run: pnpm run \"$BUILD_SCRIPT\"\n\n - name: Assemble site\n env:\n DEPLOY_TYPE: ${{ inputs.type }}\n SITE_NAME: ${{ inputs.name }}\n PROJECTS: ${{ inputs.storybook-projects }}\n STORYBOOK_OUTPUT_DIR: ${{ inputs.output-dir }}\n run: |\n mkdir -p _site\n if [ \"$DEPLOY_TYPE\" = \"docs\" ]; then\n if [ -n \"$SITE_NAME\" ]; then\n # Site built with base: /<name>/ — nest under _site/<name>/ so asset\n # paths match (/name/_astro/... → served at /name/_astro/...).\n mkdir -p \"_site/${SITE_NAME}\"\n cp -r docs/dist/. \"_site/${SITE_NAME}/\"\n # Redirect root to the base path so the preview URL lands correctly.\n printf \"/ /%s/ 301\\n\" \"$SITE_NAME\" > _site/_redirects\n else\n cp -r docs/dist/. _site/\n fi\n fi\n if [ \"$PROJECTS\" != \"[]\" ]; then\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n name=$(echo \"$project\" | jq -r '.name // \"\"')\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n outputDir=$(echo \"$project\" | jq -r '.outputDir // \"storybook-static\"')\n if [ -n \"$name\" ]; then\n target=\"_site/sandbox/${name}\"\n else\n target=\"_site/sandbox\"\n fi\n mkdir -p \"$target\"\n cp -r \"${workingDir}/${outputDir}/.\" \"$target/\"\n done\n elif [ \"$DEPLOY_TYPE\" = \"storybook\" ]; then\n mkdir -p _site/sandbox\n cp -r \"${STORYBOOK_OUTPUT_DIR}/.\" _site/sandbox/\n fi\n\n - name: Install Wrangler\n # The action's install step runs npm/pnpm in the repo root; pnpm fails\n # because it rejects adding to a workspace root without -w, and npm fails\n # because package.json contains pnpm catalog: references it cannot parse.\n # Pre-installing from /tmp (no package.json) lets the action find wrangler\n # already on PATH and skip its own install entirely.\n working-directory: /tmp\n run: npm install -g wrangler@4\n\n - name: Warn when the Cloudflare account id is missing\n # The deploy below needs it. It is an organization variable that `holocron sync secrets` writes from\n # the 1Password Environment named by `repo.variables.sync` in .holocron/repo.ts.\n if: ${{ (inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '') && (vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID) == '' }}\n run: echo \"::warning title=CLOUDFLARE_ACCOUNT_ID is not set::The Pages deploy needs it. Add it to the 1Password Environment behind repo.variables.sync and run holocron sync secrets.\"\n\n - uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3\n id: deploy\n name: Deploy to Cloudflare Pages\n # Skip when neither the per-repo input nor the org variable is set.\n if: ${{ inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '' }}\n with:\n apiToken: ${{ secrets.HOLOCRON_CLOUDFLARE_TOKEN || secrets.CLOUDFLARE_API_TOKEN }}\n accountId: ${{ vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID }}\n packageManager: npm\n command: >-\n pages deploy _site\n --project-name ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n --branch ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}\n --commit-dirty=true\n\n - name: Report preview URL\n if: ${{ steps.deploy.outputs.pages-deployment-alias-url != '' }}\n env:\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n ALIAS: ${{ steps.deploy.outputs.pages-deployment-alias-url }}\n SITE_NAME: ${{ inputs.name }}\n PROJECT: ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n run: |\n PREVIEW_URL=\"${ALIAS%/}${SITE_NAME:+/${SITE_NAME}}/\"\n # GITHUB_HEAD_REF is the PR branch name — links the deployment to this PR's sidebar widget.\n PAYLOAD=$(printf '{\"ref\":\"%s\",\"environment\":\"%s\",\"description\":\"Cloudflare Pages\",\"production_environment\":false,\"auto_merge\":false,\"required_contexts\":[]}' \\\n \"$GITHUB_HEAD_REF\" \"${PROJECT} (Preview)\")\n DEPLOY_ID=$(echo \"$PAYLOAD\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n --method POST --input - | jq -r '.id')\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${DEPLOY_ID}/statuses\" \\\n --method POST --field state=success --field environment_url=\"${PREVIEW_URL}\"\n\n cleanup:\n name: Clean up Preview\n if: ${{ github.event.action == 'closed' }}\n runs-on: ubuntu-latest\n permissions:\n contents: read\n deployments: write\n pull-requests: write\n steps:\n - name: Warn when the Cloudflare account id is missing\n # Without it the request below cannot find the preview deployments, so closing the PR leaves them behind.\n if: ${{ (inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '') && (vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID) == '' }}\n run: echo \"::warning title=CLOUDFLARE_ACCOUNT_ID is not set::The preview deployments cannot be deleted without it. Add it to the 1Password Environment behind repo.variables.sync and run holocron sync secrets.\"\n\n - name: Delete Cloudflare Pages deployments for branch\n if: ${{ inputs.cloudflare-project != '' || (vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT) != '' }}\n env:\n CLOUDFLARE_API_TOKEN: ${{ secrets.HOLOCRON_CLOUDFLARE_TOKEN || secrets.CLOUDFLARE_API_TOKEN }}\n CLOUDFLARE_ACCOUNT_ID: ${{ vars.HOLOCRON_CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID }}\n PROJECT: ${{ inputs.cloudflare-project || vars.HOLOCRON_CLOUDFLARE_PAGES_PROJECT || vars.CLOUDFLARE_PAGES_PROJECT }}\n BRANCH: ${{ github.event.repository.name }}-pr-${{ github.event.pull_request.number }}\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n run: |\n DEPLOYMENTS=$(curl -s \\\n \"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${PROJECT}/deployments\" \\\n -H \"Authorization: Bearer ${CLOUDFLARE_API_TOKEN}\" \\\n | jq -r --arg b \"$BRANCH\" \\\n '.result[] | select(.deployment_trigger.metadata.branch == $b) | .id')\n\n if [ -z \"$DEPLOYMENTS\" ]; then\n echo \"No deployments found for branch ${BRANCH} — nothing to clean up.\"\n exit 0\n fi\n\n for id in $DEPLOYMENTS; do\n echo \"Deleting CF Pages deployment: $id\"\n curl -s -X DELETE \\\n \"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${PROJECT}/deployments/${id}?force=true\" \\\n -H \"Authorization: Bearer ${CLOUDFLARE_API_TOKEN}\" | jq -r 'if .success then \" ✓ deleted\" else \" ✗ \\(.errors[0].message)\" end'\n done\n\n # Mark the GitHub Deployment environment as inactive.\n ENV_NAME=\"${PROJECT} (Preview)\"\n gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n | jq -r \".[] | select(.environment == \\\"${ENV_NAME}\\\") | .id\" \\\n | while read -r deploy_id; do\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" \\\n --method POST --field state=inactive 2>/dev/null || true\n done\n";
|
|
70
70
|
var publish_wiki_default$1 = "name: Wiki\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n fern-version:\n description: >\n Fern CLI version to install. Pin this to avoid breaking changes when\n Fern updates their config schema.\n type: string\n required: false\n default: \"5.114.1\"\n preview:\n description: >\n When true, publishes a preview instead of production.\n Requires preview-id to be set.\n type: boolean\n required: false\n default: false\n preview-id:\n description: >\n Stable ID for the preview build. Use the PR number (e.g. \"pr-123\")\n so the same preview URL is reused on every push to the branch.\n type: string\n required: false\n default: \"\"\n fern-org:\n description: >\n DEPRECATED — the preview URL is now read from Fern's own output.\n Kept as a fallback for building the URL when that parse fails, and so\n existing callers do not error.\n type: string\n required: false\n default: \"\"\n base-path:\n description: >\n DEPRECATED — see fern-org. Basepath appended to the fallback preview\n URL (e.g. \"holocron\" for multi-source routing).\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_FERN_TOKEN:\n required: false\n FERN_TOKEN:\n required: false\n\njobs:\n publish:\n name: Publish to Fern\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n deployments: write\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - name: Install Fern CLI\n run: npm install -g \"fern-api@$FERN_VERSION\"\n env:\n FERN_VERSION: ${{ inputs.fern-version }}\n\n - name: Publish docs\n if: ${{ !inputs.preview }}\n run: fern generate --docs\n env:\n FERN_TOKEN: ${{ secrets.HOLOCRON_FERN_TOKEN || secrets.FERN_TOKEN }}\n\n - name: Preview docs\n id: preview\n if: ${{ inputs.preview && inputs.preview-id != '' }}\n env:\n FERN_TOKEN: ${{ secrets.HOLOCRON_FERN_TOKEN || secrets.FERN_TOKEN }}\n PREVIEW_ID: ${{ inputs.preview-id }}\n run: |\n out=$(fern generate --docs --preview --id \"$PREVIEW_ID\" 2>&1) || { printf '%s\\n' \"$out\"; exit 1; }\n printf '%s\\n' \"$out\"\n # Fern prints \"Published docs to https://<org>-preview-<id>.docs.buildwithfern.com/<path>\"\n url=$(printf '%s\\n' \"$out\" | grep -oiE 'https://[a-z0-9.-]+\\.docs\\.buildwithfern\\.com[^ )]*' | head -n1)\n echo \"url=$url\" >> \"$GITHUB_OUTPUT\"\n\n - name: Report preview URL\n if: ${{ inputs.preview && inputs.preview-id != '' }}\n env:\n GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n CAPTURED_URL: ${{ steps.preview.outputs.url }}\n FERN_ORG: ${{ inputs.fern-org }}\n PREVIEW_ID: ${{ inputs.preview-id }}\n BASE_PATH: ${{ inputs.base-path }}\n run: |\n PREVIEW_URL=\"$CAPTURED_URL\"\n if [ -z \"$PREVIEW_URL\" ] && [ -n \"$FERN_ORG\" ]; then\n PREVIEW_URL=\"https://${FERN_ORG}-preview-${PREVIEW_ID}.docs.buildwithfern.com${BASE_PATH:+/${BASE_PATH}}\"\n fi\n if [ -z \"$PREVIEW_URL\" ]; then\n echo \"::warning::no preview URL parsed from Fern output and no fern-org fallback — skipping the deployment widget\"\n exit 0\n fi\n PAYLOAD=$(printf '{\"ref\":\"%s\",\"environment\":\"wiki (Preview)\",\"description\":\"Wiki\",\"production_environment\":false,\"auto_merge\":false,\"required_contexts\":[]}' \\\n \"$GITHUB_HEAD_REF\")\n DEPLOY_ID=$(printf '%s\\n' \"$PAYLOAD\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" \\\n --method POST --input - | jq -r '.id')\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${DEPLOY_ID}/statuses\" \\\n --method POST --field state=success --field environment_url=\"$PREVIEW_URL\"\n";
|
|
71
71
|
var reconcile_projects_default$1 = "name: Reconcile Projects\n\n# Keeps the project boards true to their rules (SPEC-0020, #1744): runs `holocron reconcile project`, which sets an item's\n# status from the issue's state and its \"blocked by\" links (an open blocker means blocked, no blocker left means planned,\n# a closed issue means done), then `holocron doctor project`, which reports what reconcile cannot fix.\n#\n# `GITHUB_TOKEN` cannot write an organization project, so the job mints an installation token from a GitHub App. The App\n# needs the organization permission Projects (read and write), which a person grants; its id and private key reach the job\n# as the secrets below (`secrets: inherit` passes them from the caller). The boards a repo keeps come from its own\n# `providers.projects` in holocron.config.ts, so a repo that declares none passes `doctor project` as a skip.\n#\n# Scheduled hourly by the caller. A failed run reaches #alerts through `platform.notifications.yml`.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n SENTINEL_GITHUB_APP_ID:\n description: The id of the GitHub App whose installation token writes the boards.\n required: false\n SENTINEL_GITHUB_APP_PRIVATE_KEY:\n description: The private key of that GitHub App.\n required: false\n SENTINEL_APP_ID:\n description: The old name of SENTINEL_GITHUB_APP_ID, read when the new one is not set.\n required: false\n SENTINEL_APP_PRIVATE_KEY:\n description: The old name of SENTINEL_GITHUB_APP_PRIVATE_KEY, read when the new one is not set.\n required: false\n\njobs:\n reconcile-projects:\n name: Reconcile and check the boards\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n # Two runs could set the same item twice, so a second waits for the first.\n concurrency:\n group: reconcile-projects\n cancel-in-progress: false\n steps:\n - name: Generate GitHub App token\n id: app-token\n uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0\n with:\n app-id: ${{ vars.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_GITHUB_APP_ID || secrets.SENTINEL_APP_ID }}\n private-key: ${{ secrets.SENTINEL_GITHUB_APP_PRIVATE_KEY || secrets.SENTINEL_APP_PRIVATE_KEY }}\n owner: ${{ github.repository_owner }}\n permission-organization-projects: write\n permission-issues: read\n permission-pull-requests: read\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # The token goes in the environment, never on the command line.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Reconcile the boards\n id: reconcile\n env:\n HOLOCRON_ORG_TOKEN: ${{ steps.app-token.outputs.token }}\n with:\n command: reconcile project\n\n - name: List what changed\n if: ${{ !cancelled() && steps.reconcile.outputs.log-file != '' }}\n env:\n LOG_FILE: ${{ steps.reconcile.outputs.log-file }}\n run: |\n {\n echo \"### Project reconcile\"\n echo '```'\n cat \"$LOG_FILE\"\n echo '```'\n } >> \"$GITHUB_STEP_SUMMARY\"\n\n # What reconcile cannot fix: a board that differs from its template, a rule that is off, a missing App permission.\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Check the boards\n if: ${{ !cancelled() }}\n env:\n HOLOCRON_ORG_TOKEN: ${{ steps.app-token.outputs.token }}\n with:\n command: doctor project\n";
|
|
72
|
-
var release_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing.\n# actions/setup-node writes a default NODE_AUTH_TOKEN=${{ github.token }}\n# which shadows OIDC auth. We explicitly clear it so npm falls through to\n# the Trusted Publisher OIDC exchange.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n dry-run:\n description: >\n When true, runs semantic-release --dry-run: analyzes commits and\n previews the next release without git writes or publish. Only\n meaningful for workflow_dispatch triggers; push-triggered runs\n always run fully.\n type: boolean\n required: false\n default: false\n group:\n description: >\n Version group to release: a folder of the repo (`clients`,\n `observability`). Passed to the release config as RELEASE_GROUP, and\n scopes every tag lookup below to that group's `<group>-v*` tags, so\n releasing one group never reads another's. Empty releases the whole\n repo, with plain `v*` tags. Groups push release commits to the same\n branch, so release them one at a time (a matrix with `max-parallel: 1`);\n each run starts from the branch's current tip, not the commit that\n triggered the workflow.\n type: string\n required: false\n default: \"\"\n from-branch-tip:\n description: >\n When true, an ungrouped release starts from the branch's current tip\n instead of the commit that triggered the workflow. Set it when the\n repo-wide release runs after the version groups, whose release\n commits have moved the branch (semantic-release refuses to run\n behind its remote). A group always starts from the tip.\n type: boolean\n required: false\n default: false\n post-release:\n description: >\n When true, dispatches a readme sync broadcast after a successful\n release. Enable for packages consumed by other repos via the\n registry-doc system so downstream README installation blocks\n stay current.\n type: boolean\n required: false\n default: false\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n deploy-on-release:\n description: >\n When true, runs a separate `deploy` job after a successful release\n (holocron#930): `holocron deploy on-release` deploys every workspace\n package whose `delivery.deploy` task is `with: { on: release }`, when\n the release is on its channel and changes its paths. The job is its\n own check, re-runnable on its own, and gets VERCEL_TOKEN; the release\n job never sees it. Off by default, so a repo that doesn't deploy from\n its release never exposes the token.\n type: boolean\n required: false\n default: false\n sentry-project:\n description: >\n Sentry project slug for sourcemap upload and release creation after\n publishing. Omit to skip the Sentry release step entirely.\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_RELEASE_TOKEN:\n description: >\n Fine-grained PAT (Contents + Issues + Pull requests: write) owned by\n an admin. Required when the default branch is protected by a ruleset —\n github.token cannot push through rulesets, but an admin PAT can.\n Takes priority over HOLOCRON_SYNC_TOKEN. Falls back to github.token.\n required: false\n HOLOCRON_SYNC_TOKEN:\n description: >\n Legacy alias for HOLOCRON_RELEASE_TOKEN — kept for backward compatibility.\n Prefer HOLOCRON_RELEASE_TOKEN for new repos.\n required: false\n HOLOCRON_READ_TOKEN:\n description: >\n Fine-grained PAT for read-only GitHub API calls (e.g. resolving git\n committer identity via `gh api user`). Falls back to github.token.\n required: false\n GH_TOKEN:\n description: >\n Generic GitHub token fallback for `gh` CLI calls. Used when\n HOLOCRON_READ_TOKEN is not set.\n required: false\n HOLOCRON_SENTRY_RELEASE_TOKEN:\n description: The Sentry release token (sourcemaps and release creation). Read first; the SENTRY_AUTH_TOKEN secret is the fallback.\n required: false\n SENTRY_AUTH_TOKEN:\n description: >\n Sentry auth token for sourcemap upload and release creation.\n Required when sentry-project is set. Use the org-level secret.\n required: false\n HOLOCRON_TURBO_TOKEN:\n description: The Turbo remote cache token. Read first; the TURBO_TOKEN secret is the fallback.\n required: false\n TURBO_TOKEN:\n required: false\n HOLOCRON_VERCEL_TOKEN:\n description: The Vercel token. Read first; the vendor-native VERCEL_TOKEN secret is the fallback.\n required: false\n VERCEL_TOKEN:\n description: >\n Vercel token for the deploy job. Only used when deploy-on-release is\n true, and only by that job.\n required: false\n\njobs:\n release:\n name: Semantic release\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n outputs:\n # Read by the deploy job (holocron#930). Empty unless semantic-release\n # published: `commit` is the release commit, `previous` the commit of\n # the release before it (to diff against), `channel` the new version's\n # prerelease identifier (`alpha`), empty for a stable release (`main`).\n commit: ${{ steps.release.outputs.commit }}\n previous: ${{ steps.release.outputs.previous }}\n channel: ${{ steps.release.outputs.channel }}\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n with:\n fetch-depth: 0\n persist-credentials: false\n # A group's release commit moves the branch, so a later group's run must\n # release from the branch's current tip, not the commit that triggered the\n # workflow (semantic-release refuses to run behind its remote). Ungrouped,\n # the default (the triggering commit) is unchanged, unless `from-branch-tip`\n # says the groups ran first.\n ref: ${{ (inputs.group != '' || inputs.from-branch-tip) && github.ref || github.sha }}\n # Use HOLOCRON_RELEASE_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # By path: the action is new and `theholocron/.github` is frozen (see the `format` action in lint/code.yml).\n - uses: ./ci/actions/git-identity\n name: Configure git identity\n with:\n scope: global\n resolve: \"true\"\n signoff: \"true\"\n token: ${{ secrets.HOLOCRON_READ_TOKEN || secrets.GH_TOKEN || github.token }}\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - name: Release\n id: release\n run: |\n BEFORE=$(git rev-parse HEAD)\n # A group's tags are `<group>-v<version>`; without one, any tag (as before).\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n PREVIOUS_TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || true)\n PREVIOUS=\"\"\n if [ -n \"$PREVIOUS_TAG\" ]; then PREVIOUS=$(git rev-list -n 1 \"$PREVIOUS_TAG\"); fi\n if [ \"$DRY_RUN\" = \"true\" ]; then\n npx semantic-release --dry-run\n else\n npx semantic-release\n fi\n AFTER=$(git rev-parse HEAD)\n # semantic-release only commits (`chore(release): … [skip ci]`) when it\n # actually publishes. That commit gets no CI (and so no coverage\n # upload), which makes the next PR's `codecov/project` compare a full\n # report against a stale ancestor — a phantom drop (holocron#644).\n # Emit the new SHA so the steps below upload coverage for it.\n if [ \"$BEFORE\" != \"$AFTER\" ]; then\n echo \"commit=$AFTER\" >> \"$GITHUB_OUTPUT\"\n echo \"previous=$PREVIOUS\" >> \"$GITHUB_OUTPUT\"\n # The new version's channel: the prerelease identifier of its tag\n # (v5.0.0-alpha.108 or cli-v5.0.0-alpha.108 -> alpha), empty for a stable release.\n VERSION=$(git describe --tags --abbrev=0 \"${MATCH[@]}\")\n VERSION=${VERSION#\"$PREFIX\"}\n CHANNEL=\"\"\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n echo \"channel=$CHANNEL\" >> \"$GITHUB_OUTPUT\"\n fi\n env:\n DRY_RUN: ${{ inputs.dry-run }}\n # Read by the repo's release config to release one version group.\n RELEASE_GROUP: ${{ inputs.group }}\n # Prefer HOLOCRON_RELEASE_TOKEN (fine-grained PAT, Contents+Issues+PRs write,\n # owned by an admin with ruleset bypass) so @semantic-release/git can\n # push the version-bump commit through branch protection. Falls back to\n # HOLOCRON_SYNC_TOKEN (legacy) then github.token for unprotected repos.\n GITHUB_TOKEN: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n HUSKY: \"0\"\n NPM_CONFIG_PROVENANCE: true\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Coverage for the release commit\n if: ${{ steps.release.outputs.commit != '' }}\n with:\n task: test:unit\n\n - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1\n name: Upload release-commit coverage to Codecov\n if: ${{ steps.release.outputs.commit != '' }}\n # fail_ci_if_error makes a failed upload fail this step, so it is visible, but\n # continue-on-error keeps it from failing the job: the release has already\n # published, and the Sentry release steps below must still run (holocron#934).\n continue-on-error: true\n with:\n use_oidc: true\n fail_ci_if_error: true\n override_commit: ${{ steps.release.outputs.commit }}\n override_branch: ${{ github.ref_name }}\n\n - name: Get release version\n id: release_version\n if: ${{ inputs.sentry-project != '' && inputs.dry-run != true }}\n env:\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n RELEASE_GROUP: ${{ inputs.group }}\n run: |\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || echo \"\")\n if [ -n \"$TAG\" ]; then\n echo \"release=${SENTRY_PROJECT}@${TAG#\"$PREFIX\"}\" >> \"$GITHUB_OUTPUT\"\n fi\n\n - name: Create Sentry release\n if: ${{ inputs.sentry-project != '' && steps.release_version.outputs.release != '' && inputs.dry-run != true }}\n uses: getsentry/action-release@d55c8c3b7375607e972b710f12926b676d89d7d2 # v3\n env:\n SENTRY_AUTH_TOKEN: ${{ secrets.HOLOCRON_SENTRY_RELEASE_TOKEN || secrets.SENTRY_AUTH_TOKEN }}\n SENTRY_ORG: ${{ vars.HOLOCRON_SENTRY_ORG || vars.SENTRY_ORG }}\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n with:\n environment: production\n version: ${{ steps.release_version.outputs.release }}\n sourcemaps: \"**/dist\"\n\n deploy:\n name: Deploy\n needs: release\n # Only after a release that actually published (`commit` is empty on a dry\n # run or when nothing was released). A failed deploy fails only this job:\n # the release is already on npm, and this job re-runs on its own.\n if: ${{ inputs.deploy-on-release == true && inputs.dry-run != true && needs.release.outputs.commit != '' }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout the release commit\n with:\n ref: ${{ needs.release.outputs.commit }}\n fetch-depth: 0\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Deploy packages that deploy on release\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n with:\n command: deploy on-release\n args: >-\n --channel=${{ needs.release.outputs.channel }}\n --from=${{ needs.release.outputs.previous }}\n --to=${{ needs.release.outputs.commit }}\n\n sync-readme:\n name: Post-release readme sync\n needs: release\n if: ${{ inputs.post-release == true && inputs.dry-run != true }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - name: Trigger broadcast readme sync\n run: |\n gh workflow run sync-dispatch.yml \\\n --repo \"$GITHUB_REPOSITORY_OWNER/.github\" \\\n --field \"steps=readme\"\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_SYNC_TOKEN || secrets.GH_TOKEN }}\n";
|
|
72
|
+
var release_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing.\n# actions/setup-node writes a default NODE_AUTH_TOKEN=${{ github.token }}\n# which shadows OIDC auth. We explicitly clear it so npm falls through to\n# the Trusted Publisher OIDC exchange.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n dry-run:\n description: >\n When true, runs semantic-release --dry-run: analyzes commits and\n previews the next release without git writes or publish. Only\n meaningful for workflow_dispatch triggers; push-triggered runs\n always run fully.\n type: boolean\n required: false\n default: false\n group:\n description: >\n Version group to release: a folder of the repo (`clients`,\n `observability`). Passed to the release config as RELEASE_GROUP, and\n scopes every tag lookup below to that group's `<group>-v*` tags, so\n releasing one group never reads another's. Empty releases the whole\n repo, with plain `v*` tags. Groups push release commits to the same\n branch, so release them one at a time (a matrix with `max-parallel: 1`);\n each run starts from the branch's current tip, not the commit that\n triggered the workflow.\n type: string\n required: false\n default: \"\"\n from-branch-tip:\n description: >\n When true, an ungrouped release starts from the branch's current tip\n instead of the commit that triggered the workflow. Set it when the\n repo-wide release runs after the version groups, whose release\n commits have moved the branch (semantic-release refuses to run\n behind its remote). A group always starts from the tip.\n type: boolean\n required: false\n default: false\n post-release:\n description: >\n When true, dispatches a readme sync broadcast after a successful\n release. Enable for packages consumed by other repos via the\n registry-doc system so downstream README installation blocks\n stay current.\n type: boolean\n required: false\n default: false\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n deploy-on-release:\n description: >\n When true, runs a separate `deploy` job after a successful release\n (holocron#930): `holocron deploy on-release` deploys every workspace\n package whose `delivery.deploy` task is `with: { on: release }`, when\n the release is on its channel and changes its paths. The job is its\n own check, re-runnable on its own, and gets VERCEL_TOKEN; the release\n job never sees it. Off by default, so a repo that doesn't deploy from\n its release never exposes the token.\n type: boolean\n required: false\n default: false\n sentry-project:\n description: >\n Sentry project slug for sourcemap upload and release creation after\n publishing. Omit to skip the Sentry release step entirely.\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_RELEASE_TOKEN:\n description: >\n Fine-grained PAT (Contents + Issues + Pull requests: write) owned by\n an admin. Required when the default branch is protected by a ruleset —\n github.token cannot push through rulesets, but an admin PAT can.\n Takes priority over HOLOCRON_SYNC_TOKEN. Falls back to github.token.\n required: false\n HOLOCRON_SYNC_TOKEN:\n description: >\n Legacy alias for HOLOCRON_RELEASE_TOKEN — kept for backward compatibility.\n Prefer HOLOCRON_RELEASE_TOKEN for new repos.\n required: false\n HOLOCRON_READ_TOKEN:\n description: >\n Fine-grained PAT for read-only GitHub API calls (e.g. resolving git\n committer identity via `gh api user`). Falls back to github.token.\n required: false\n GH_TOKEN:\n description: >\n Generic GitHub token fallback for `gh` CLI calls. Used when\n HOLOCRON_READ_TOKEN is not set.\n required: false\n HOLOCRON_SENTRY_RELEASE_TOKEN:\n description: The Sentry release token (sourcemaps and release creation). Read first; the SENTRY_AUTH_TOKEN secret is the fallback.\n required: false\n SENTRY_AUTH_TOKEN:\n description: >\n Sentry auth token for sourcemap upload and release creation.\n Required when sentry-project is set. Use the org-level secret.\n required: false\n HOLOCRON_TURBO_TOKEN:\n description: The Turbo remote cache token. Read first; the TURBO_TOKEN secret is the fallback.\n required: false\n TURBO_TOKEN:\n required: false\n HOLOCRON_VERCEL_TOKEN:\n description: The Vercel token. Read first; the vendor-native VERCEL_TOKEN secret is the fallback.\n required: false\n VERCEL_TOKEN:\n description: >\n Vercel token for the deploy job. Only used when deploy-on-release is\n true, and only by that job.\n required: false\n\njobs:\n release:\n name: Semantic release\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n outputs:\n # Read by the deploy job (holocron#930). Empty unless semantic-release\n # published: `commit` is the release commit, `previous` the commit of\n # the release before it (to diff against), `channel` the new version's\n # prerelease identifier (`alpha`), empty for a stable release (`main`).\n commit: ${{ steps.release.outputs.commit }}\n previous: ${{ steps.release.outputs.previous }}\n channel: ${{ steps.release.outputs.channel }}\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n with:\n fetch-depth: 0\n persist-credentials: false\n # A group's release commit moves the branch, so a later group's run must\n # release from the branch's current tip, not the commit that triggered the\n # workflow (semantic-release refuses to run behind its remote). Ungrouped,\n # the default (the triggering commit) is unchanged, unless `from-branch-tip`\n # says the groups ran first.\n ref: ${{ (inputs.group != '' || inputs.from-branch-tip) && github.ref || github.sha }}\n # Use HOLOCRON_RELEASE_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # By path: the action is new and `theholocron/.github` is frozen (see the `format` action in lint/code.yml).\n - uses: ./ci/actions/git-identity\n name: Configure git identity\n with:\n scope: global\n resolve: \"true\"\n signoff: \"true\"\n token: ${{ secrets.HOLOCRON_READ_TOKEN || secrets.GH_TOKEN || github.token }}\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - name: Release\n id: release\n run: |\n BEFORE=$(git rev-parse HEAD)\n # A group's tags are `<group>-v<version>`; without one, any tag (as before).\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n PREVIOUS_TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || true)\n PREVIOUS=\"\"\n if [ -n \"$PREVIOUS_TAG\" ]; then PREVIOUS=$(git rev-list -n 1 \"$PREVIOUS_TAG\"); fi\n if [ \"$DRY_RUN\" = \"true\" ]; then\n npx semantic-release --dry-run\n else\n npx semantic-release\n fi\n AFTER=$(git rev-parse HEAD)\n # semantic-release only commits (`chore(release): … [skip ci]`) when it\n # actually publishes. That commit gets no CI (and so no coverage\n # upload), which makes the next PR's `codecov/project` compare a full\n # report against a stale ancestor — a phantom drop (holocron#644).\n # Emit the new SHA so the steps below upload coverage for it.\n if [ \"$BEFORE\" != \"$AFTER\" ]; then\n echo \"commit=$AFTER\" >> \"$GITHUB_OUTPUT\"\n echo \"previous=$PREVIOUS\" >> \"$GITHUB_OUTPUT\"\n # The new version's channel: the prerelease identifier of its tag\n # (v5.0.0-alpha.108 or cli-v5.0.0-alpha.108 -> alpha), empty for a stable release.\n VERSION=$(git describe --tags --abbrev=0 \"${MATCH[@]}\")\n VERSION=${VERSION#\"$PREFIX\"}\n CHANNEL=\"\"\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n echo \"channel=$CHANNEL\" >> \"$GITHUB_OUTPUT\"\n fi\n env:\n DRY_RUN: ${{ inputs.dry-run }}\n # Read by the repo's release config to release one version group.\n RELEASE_GROUP: ${{ inputs.group }}\n # Prefer HOLOCRON_RELEASE_TOKEN (fine-grained PAT, Contents+Issues+PRs write,\n # owned by an admin with ruleset bypass) so @semantic-release/git can\n # push the version-bump commit through branch protection. Falls back to\n # HOLOCRON_SYNC_TOKEN (legacy) then github.token for unprotected repos.\n GITHUB_TOKEN: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n HUSKY: \"0\"\n NPM_CONFIG_PROVENANCE: true\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Coverage for the release commit\n if: ${{ steps.release.outputs.commit != '' }}\n with:\n task: test:unit\n\n - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1\n name: Upload release-commit coverage to Codecov\n if: ${{ steps.release.outputs.commit != '' }}\n # fail_ci_if_error makes a failed upload fail this step, so it is visible, but\n # continue-on-error keeps it from failing the job: the release has already\n # published, and the Sentry release steps below must still run (holocron#934).\n continue-on-error: true\n with:\n use_oidc: true\n fail_ci_if_error: true\n override_commit: ${{ steps.release.outputs.commit }}\n override_branch: ${{ github.ref_name }}\n\n - name: Get release version\n id: release_version\n if: ${{ inputs.sentry-project != '' && inputs.dry-run != true }}\n env:\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n RELEASE_GROUP: ${{ inputs.group }}\n run: |\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || echo \"\")\n if [ -n \"$TAG\" ]; then\n echo \"release=${SENTRY_PROJECT}@${TAG#\"$PREFIX\"}\" >> \"$GITHUB_OUTPUT\"\n fi\n\n - name: Create Sentry release\n if: ${{ inputs.sentry-project != '' && steps.release_version.outputs.release != '' && inputs.dry-run != true }}\n uses: getsentry/action-release@d55c8c3b7375607e972b710f12926b676d89d7d2 # v3\n env:\n SENTRY_AUTH_TOKEN: ${{ secrets.HOLOCRON_SENTRY_RELEASE_TOKEN || secrets.SENTRY_AUTH_TOKEN }}\n SENTRY_ORG: ${{ vars.HOLOCRON_SENTRY_ORG || vars.SENTRY_ORG }}\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n with:\n environment: production\n version: ${{ steps.release_version.outputs.release }}\n sourcemaps: \"**/dist\"\n\n deploy:\n name: Deploy\n needs: release\n # Only after a release that actually published (`commit` is empty on a dry\n # run or when nothing was released). A failed deploy fails only this job:\n # the release is already on npm, and this job re-runs on its own.\n if: ${{ inputs.deploy-on-release == true && inputs.dry-run != true && needs.release.outputs.commit != '' }}\n permissions:\n contents: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout the release commit\n with:\n ref: ${{ needs.release.outputs.commit }}\n fetch-depth: 0\n # The deploy records each success as a `deployed/<package>` tag (holocron#2330), which needs the job's token.\n persist-credentials: true\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Deploy packages that deploy on release\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n with:\n command: deploy on-release\n args: >-\n --channel=${{ needs.release.outputs.channel }}\n --from=${{ needs.release.outputs.previous }}\n --to=${{ needs.release.outputs.commit }}\n\n sync-readme:\n name: Post-release readme sync\n needs: release\n if: ${{ inputs.post-release == true && inputs.dry-run != true }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - name: Trigger broadcast readme sync\n run: |\n gh workflow run sync-dispatch.yml \\\n --repo \"$GITHUB_REPOSITORY_OWNER/.github\" \\\n --field \"steps=readme\"\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_SYNC_TOKEN || secrets.GH_TOKEN }}\n";
|
|
73
73
|
var remind_doctor_default$1 = "name: Remind Doctor\n\n# A weekly nudge to run the drift check by hand (#1585). `holocron doctor notifications` compares the layout with the\n# live server and reads the Worker, the tracker and the secrets with provider tokens, which stay on a maintainer's\n# machine rather than in CI. This posts one line to #alerts, no ping, naming the command that checks and shares the\n# result. A missing webhook secret skips the post and never fails the run.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_NOTIFY_WEBHOOK_ALERTS:\n description: The #alerts webhook the reminder posts to. Without it the post is skipped.\n required: false\n\njobs:\n remind-doctor:\n name: Remind to run the drift check\n permissions: {}\n runs-on: ubuntu-latest\n timeout-minutes: 2\n steps:\n - uses: theholocron/.github/.github/actions/notify@main\n name: \"Remind #alerts\"\n with:\n webhook: ${{ secrets.HOLOCRON_NOTIFY_WEBHOOK_ALERTS }}\n message: \"🩺 ${{ github.repository }}: time for the weekly drift check. Run `holocron doctor notifications --built-only --post` to compare the server with the layout and post the result here.\"\n";
|
|
74
74
|
var code_default$2 = "name: Security\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n language:\n description: CodeQL language to analyze\n type: string\n required: false\n default: javascript-typescript\n\njobs:\n analyze:\n name: Analyze (${{ inputs.language }})\n permissions:\n actions: read\n contents: read\n security-events: write\n runs-on: ubuntu-latest\n timeout-minutes: 45\n # Do not cancel in-progress security scans.\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3\n name: Initialize CodeQL\n with:\n languages: ${{ inputs.language }}\n\n - uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3\n name: Autobuild\n\n - uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3\n name: Analyze\n with:\n category: /language:${{ inputs.language }}\n";
|
|
75
75
|
var secrets_default$1 = "name: Secret Detection\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_TURBO_TOKEN:\n description: The Turbo remote cache token. Read first; the TURBO_TOKEN secret is the fallback.\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n secret-detection:\n name: Run gitleaks\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n with:\n fetch-depth: 0\n\n # gitleaks has no npm distribution — install the prebuilt binary via\n # the maintainer's own documented install script.\n # NOTE: unverified against a live CI run at authoring time (D12) — flag\n # here if this needs adjustment.\n - name: Install gitleaks\n run: |\n curl -sSfL https://raw.githubusercontent.com/gitleaks/gitleaks/master/install.sh | sh -s -- -b /usr/local/bin\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run gitleaks\n with:\n task: scan:secrets\n";
|
|
@@ -3157,6 +3157,57 @@ function workspaceDependencies(pkg, all, options) {
|
|
|
3157
3157
|
function defaultPaths(repoRoot, pkg, all) {
|
|
3158
3158
|
return [pkg, ...workspaceDependencies(pkg, all, { includeDevDependencies: true })].map(({ dir }) => `${relative(repoRoot, dir).replace(/\\/g, "/")}/`);
|
|
3159
3159
|
}
|
|
3160
|
+
// src/tasks/deploy-on-release/deploy-marker/marker-tag.ts
|
|
3161
|
+
/**
|
|
3162
|
+
* The tag that records the commit a package was last deployed at: `deployed/<name>`, the package name with the scope's `@`
|
|
3163
|
+
* dropped and `/` made `-` (`@theholocron/sentinel` is `deployed/theholocron-sentinel`).
|
|
3164
|
+
*/
|
|
3165
|
+
function markerTag(pkgName) {
|
|
3166
|
+
return `deployed/${pkgName.replace(/^@/, "").replace(/\//g, "-")}`;
|
|
3167
|
+
}
|
|
3168
|
+
// src/tasks/deploy-on-release/deploy-marker/read-marker.ts
|
|
3169
|
+
/**
|
|
3170
|
+
* Reads the deploy marker `tag` and checks it is an ancestor of `to`, so a rewritten history never makes the
|
|
3171
|
+
* diff meaningless. A missing tag is not an error: it is a package that has no recorded deploy yet.
|
|
3172
|
+
*/
|
|
3173
|
+
function readMarker(run, cwd, tag, to) {
|
|
3174
|
+
const found = run("git", [
|
|
3175
|
+
"rev-parse",
|
|
3176
|
+
"--quiet",
|
|
3177
|
+
"--verify",
|
|
3178
|
+
`refs/tags/${tag}^{commit}`
|
|
3179
|
+
], { cwd });
|
|
3180
|
+
const sha = found.stdout.trim();
|
|
3181
|
+
if (found.status !== 0 || !sha) return {};
|
|
3182
|
+
return run("git", [
|
|
3183
|
+
"merge-base",
|
|
3184
|
+
"--is-ancestor",
|
|
3185
|
+
sha,
|
|
3186
|
+
to
|
|
3187
|
+
], { cwd }).status === 0 ? { sha } : { note: `${tag} (${sha.slice(0, 7)}) is not an ancestor of ${to}; ignoring it` };
|
|
3188
|
+
}
|
|
3189
|
+
// src/tasks/deploy-on-release/deploy-marker/write-marker.ts
|
|
3190
|
+
/**
|
|
3191
|
+
* Records that a package is deployed at `to`: moves the tag `tag` there and pushes it. Returns a problem line, or
|
|
3192
|
+
* `undefined` on success. The deploy already happened, so a failure here is a warning, not a failed deploy: the
|
|
3193
|
+
* worst case is that the next release deploys the package again.
|
|
3194
|
+
*/
|
|
3195
|
+
function writeMarker(run, cwd, tag, to) {
|
|
3196
|
+
const made = run("git", [
|
|
3197
|
+
"tag",
|
|
3198
|
+
"--force",
|
|
3199
|
+
tag,
|
|
3200
|
+
to
|
|
3201
|
+
], { cwd });
|
|
3202
|
+
if (made.status !== 0) return `couldn't tag ${tag}: ${made.stderr.trim() || made.status}`;
|
|
3203
|
+
const pushed = run("git", [
|
|
3204
|
+
"push",
|
|
3205
|
+
"--force",
|
|
3206
|
+
"origin",
|
|
3207
|
+
`refs/tags/${tag}`
|
|
3208
|
+
], { cwd });
|
|
3209
|
+
return pushed.status === 0 ? void 0 : `couldn't push ${tag}: ${pushed.stderr.trim() || pushed.status}`;
|
|
3210
|
+
}
|
|
3160
3211
|
// src/tasks/deploy-on-release/deploy-script/deploy-script.ts
|
|
3161
3212
|
/** The `scripts` of the `package.json` in `dir`; empty when it has none or cannot be read. */
|
|
3162
3213
|
function scriptsOf(readJson, dir) {
|
|
@@ -3290,6 +3341,11 @@ function workspacePackages(repoRoot, { readJson, listDirs }) {
|
|
|
3290
3341
|
* it has just accepted, and the deploy installs them — then runs
|
|
3291
3342
|
* `pnpm --filter <package> run deploy` (its old `delivery.deploy` script when that is the one it has).
|
|
3292
3343
|
*
|
|
3344
|
+
* Each package diffs from the commit it was last deployed at, not from the previous release: a successful deploy
|
|
3345
|
+
* moves a `deployed/<package>` tag to the release commit ({@link markerTag}), so a release whose deploy job failed
|
|
3346
|
+
* is made up by the next release even if that one touches nothing in the app. A package with no tag yet falls back
|
|
3347
|
+
* to the previous release.
|
|
3348
|
+
*
|
|
3293
3349
|
* The release is already published by then, so a failed deploy can't undo it;
|
|
3294
3350
|
* it fails this job instead, loudly and re-runnable on its own. A task is
|
|
3295
3351
|
* `skip`ped (not failed) only when it doesn't apply to this release.
|
|
@@ -3323,20 +3379,23 @@ async function deployOnRelease(options, { run = defaultRun, readJson = defaultRe
|
|
|
3323
3379
|
results: []
|
|
3324
3380
|
};
|
|
3325
3381
|
}
|
|
3326
|
-
|
|
3327
|
-
const changedFiles = () => {
|
|
3328
|
-
if (
|
|
3329
|
-
|
|
3382
|
+
const diffs = /* @__PURE__ */ new Map();
|
|
3383
|
+
const changedFiles = (base) => {
|
|
3384
|
+
if (!base) return { files: void 0 };
|
|
3385
|
+
const known = diffs.get(base);
|
|
3386
|
+
if (known) return known;
|
|
3330
3387
|
const result = run("git", [
|
|
3331
3388
|
"diff",
|
|
3332
3389
|
"--name-only",
|
|
3333
|
-
|
|
3390
|
+
base,
|
|
3334
3391
|
to
|
|
3335
3392
|
], { cwd });
|
|
3336
|
-
|
|
3393
|
+
const diff = result.status === 0 ? { files: result.stdout.split("\n").filter(Boolean) } : {
|
|
3337
3394
|
files: [],
|
|
3338
|
-
error: `git diff ${
|
|
3395
|
+
error: `git diff ${base} ${to} failed: ${result.stderr || result.status}`
|
|
3339
3396
|
};
|
|
3397
|
+
diffs.set(base, diff);
|
|
3398
|
+
return diff;
|
|
3340
3399
|
};
|
|
3341
3400
|
const results = [];
|
|
3342
3401
|
const record = (pkg, status, message) => {
|
|
@@ -3349,7 +3408,12 @@ async function deployOnRelease(options, { run = defaultRun, readJson = defaultRe
|
|
|
3349
3408
|
};
|
|
3350
3409
|
for (const target of targets) {
|
|
3351
3410
|
const name = target.pkg.name;
|
|
3352
|
-
const
|
|
3411
|
+
const matches = target.channel === channel;
|
|
3412
|
+
const tag = markerTag(name);
|
|
3413
|
+
const marker = matches ? readMarker(run, cwd, tag, to) : {};
|
|
3414
|
+
if (marker.note) print(`${name}: ${marker.note}.`);
|
|
3415
|
+
const base = marker.sha ?? from;
|
|
3416
|
+
const { files, error } = matches ? changedFiles(base) : {
|
|
3353
3417
|
files: [],
|
|
3354
3418
|
error: void 0
|
|
3355
3419
|
};
|
|
@@ -3363,12 +3427,14 @@ async function deployOnRelease(options, { run = defaultRun, readJson = defaultRe
|
|
|
3363
3427
|
changedFiles: files,
|
|
3364
3428
|
paths: target.paths ?? defaultPaths(cwd, target.pkg, packages)
|
|
3365
3429
|
});
|
|
3430
|
+
const since = marker.sha ? ` since its last deploy (${marker.sha.slice(0, 7)})` : "";
|
|
3366
3431
|
if (!decision.deploy) {
|
|
3367
|
-
|
|
3432
|
+
const untracked = matches && !marker.sha ? " No deploy is recorded for it yet." : "";
|
|
3433
|
+
record(name, "skip", `not deploying: ${decision.reason}${since}.${untracked}`);
|
|
3368
3434
|
continue;
|
|
3369
3435
|
}
|
|
3370
3436
|
if (options.dryRun) {
|
|
3371
|
-
record(name, "dry-run", `would deploy because ${decision.reason}.`);
|
|
3437
|
+
record(name, "dry-run", `would deploy because ${decision.reason}${since}.`);
|
|
3372
3438
|
continue;
|
|
3373
3439
|
}
|
|
3374
3440
|
const dependencies = workspaceDependencies(target.pkg, packages).flatMap(({ name: dep, version }) => version ? [{
|
|
@@ -3387,7 +3453,7 @@ async function deployOnRelease(options, { run = defaultRun, readJson = defaultRe
|
|
|
3387
3453
|
record(name, "fail", `npm still doesn't serve ${unpublished.join(", ")} after ${WAIT_TIMEOUT_MS / 6e4} minutes. Re-run this job once it does.`);
|
|
3388
3454
|
continue;
|
|
3389
3455
|
}
|
|
3390
|
-
print(`${name}: deploying because ${decision.reason}.`);
|
|
3456
|
+
print(`${name}: deploying because ${decision.reason}${since}.`);
|
|
3391
3457
|
const result = run("pnpm", [
|
|
3392
3458
|
"--filter",
|
|
3393
3459
|
name,
|
|
@@ -3398,8 +3464,10 @@ async function deployOnRelease(options, { run = defaultRun, readJson = defaultRe
|
|
|
3398
3464
|
env: process.env,
|
|
3399
3465
|
stdio: "inherit"
|
|
3400
3466
|
});
|
|
3401
|
-
if (result.status === 0)
|
|
3402
|
-
|
|
3467
|
+
if (result.status === 0) {
|
|
3468
|
+
const problem = writeMarker(run, cwd, tag, to);
|
|
3469
|
+
record(name, "ok", problem ? `deployed, but ${problem}; the next release may deploy it again.` : "deployed.");
|
|
3470
|
+
} else record(name, "fail", `the deploy failed (exit ${result.status}).`);
|
|
3403
3471
|
}
|
|
3404
3472
|
return {
|
|
3405
3473
|
status: results.some((r) => r.status === "fail") ? "fail" : results.every((r) => r.status === "skip") ? "skip" : "ok",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/astromech",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.472",
|
|
4
4
|
"description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron run ci`, the CI workflows, package.json scripts, linters, and required checks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@commitlint/lint": "^21.2.3",
|
|
56
56
|
"@commitlint/load": "^21.2.3",
|
|
57
57
|
"@commitlint/types": "^21.2.3",
|
|
58
|
-
"@theholocron/datapad": "5.0.0-alpha.
|
|
59
|
-
"@theholocron/json-utils": "^1.17.0-alpha.5",
|
|
60
|
-
"@theholocron/misc-utils": "^1.17.0-alpha.5",
|
|
58
|
+
"@theholocron/datapad": "5.0.0-alpha.472",
|
|
61
59
|
"@theholocron/fs-utils": "^1.17.0-alpha.5",
|
|
60
|
+
"@theholocron/misc-utils": "^1.17.0-alpha.5",
|
|
61
|
+
"@theholocron/json-utils": "^1.17.0-alpha.5",
|
|
62
62
|
"@theholocron/pkg-utils": "^1.17.0-alpha.5"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"@theholocron/commitlint-config": "^8.9.0-alpha.20",
|
|
78
78
|
"@theholocron/eslint-config": "^8.9.0-alpha.20",
|
|
79
79
|
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.20",
|
|
80
|
-
"@theholocron/
|
|
80
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.20",
|
|
81
81
|
"@theholocron/vitest-config": "^8.9.0-alpha.20",
|
|
82
|
-
"@theholocron/
|
|
82
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.20"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=22"
|