blueprint-shared-facts 0.10.0 → 0.11.0

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.
@@ -4,7 +4,7 @@
4
4
  "package": "blueprint-shared-facts",
5
5
  "entry": "blueprint-shared",
6
6
  "describes": {
7
- "blueprint-shared-facts": "0.10.0"
7
+ "blueprint-shared-facts": "0.11.0"
8
8
  },
9
9
  "layer": "org",
10
10
  "facts": [
@@ -381,6 +381,50 @@
381
381
  ]
382
382
  }
383
383
  }
384
+ },
385
+ {
386
+ "since": "0.11.0",
387
+ "content": {
388
+ "value": {
389
+ "rows": [
390
+ {
391
+ "job": "build and deploy in a private repository",
392
+ "runner": "the runner the organization gives in privateRepoRunner"
393
+ },
394
+ {
395
+ "job": "publish job of Trusted Publishing (npm, PyPI, crates.io)",
396
+ "runner": "GitHub-hosted (ubuntu-latest)",
397
+ "why": "Trusted Publishing accepts only GitHub-hosted runners (npm documents that self-hosted runners are not supported). The template has no PUBLISH_ENABLED condition on the job. Only a demonstration repository has it, added by compose, and the variable is unset there, so the job shows as skipped. A repository in real use does not carry the condition, and adds one only to control whether it publishes."
398
+ },
399
+ {
400
+ "job": "publish to GitHub Packages",
401
+ "runner": "the runner the organization gives in githubPackagesPublishRunner",
402
+ "shape": "one job",
403
+ "why": "It uses GITHUB_TOKEN and needs no hosted runner. A demonstration repository has the same PUBLISH_ENABLED condition on it as on the job above, and the same rule applies: the template has none and a repository in real use does not carry it."
404
+ },
405
+ {
406
+ "job": "binary job of publish.yml (executables)",
407
+ "runner": "the default label of selfHostedRunnerLabels",
408
+ "why": "It builds Go executables and needs no docker (blueprint-shared.publishing.binary-release)."
409
+ },
410
+ {
411
+ "job": "image job of publish.yml (container images)",
412
+ "runner": "the docker label of selfHostedRunnerLabels",
413
+ "why": "It builds and pushes an image, so it needs docker. When the organization gives no docker label, the job runs on the default label, and image-units.sh stops and writes the reason if that runner has no docker (blueprint-shared.publishing.container-image)."
414
+ },
415
+ {
416
+ "job": "every job of a public repository, mirror repositories included",
417
+ "runner": "GitHub-hosted (ubuntu-latest)",
418
+ "why": "A fork pull request of a public repository cannot run on self-hosted."
419
+ }
420
+ ],
421
+ "orgValues": [
422
+ "privateRepoRunner",
423
+ "githubPackagesPublishRunner",
424
+ "selfHostedRunnerLabels"
425
+ ]
426
+ }
427
+ }
384
428
  }
385
429
  ],
386
430
  "source": {
@@ -404,6 +448,16 @@
404
448
  "shape": "one job",
405
449
  "why": "It uses GITHUB_TOKEN and needs no hosted runner. A demonstration repository has the same PUBLISH_ENABLED condition on it as on the job above, and the same rule applies: the template has none and a repository in real use does not carry it."
406
450
  },
451
+ {
452
+ "job": "binary job of publish.yml (executables)",
453
+ "runner": "the default label of selfHostedRunnerLabels",
454
+ "why": "It builds Go executables and needs no docker (blueprint-shared.publishing.binary-release)."
455
+ },
456
+ {
457
+ "job": "image job of publish.yml (container images)",
458
+ "runner": "the docker label of selfHostedRunnerLabels",
459
+ "why": "It builds and pushes an image, so it needs docker. When the organization gives no docker label, the job runs on the default label, and image-units.sh stops and writes the reason if that runner has no docker (blueprint-shared.publishing.container-image)."
460
+ },
407
461
  {
408
462
  "job": "every job of a public repository, mirror repositories included",
409
463
  "runner": "GitHub-hosted (ubuntu-latest)",
@@ -412,7 +466,8 @@
412
466
  ],
413
467
  "orgValues": [
414
468
  "privateRepoRunner",
415
- "githubPackagesPublishRunner"
469
+ "githubPackagesPublishRunner",
470
+ "selfHostedRunnerLabels"
416
471
  ]
417
472
  }
418
473
  }
@@ -2121,6 +2176,42 @@
2121
2176
  "prod": "The workflow deploys what is declared. Only deploy-prod.yml writes the prod declaration"
2122
2177
  }
2123
2178
  }
2179
+ },
2180
+ {
2181
+ "since": "0.11.0",
2182
+ "content": {
2183
+ "value": {
2184
+ "file": "ops/.github/workflows/ops-deploy.yml",
2185
+ "role": "ops",
2186
+ "triggers": [
2187
+ "push to main that changes ops/versions.json, ops/versions.lock.json, ops/workloads/**, ops/iac/** or ops/needs.json",
2188
+ "workflow_dispatch with env and units"
2189
+ ],
2190
+ "steps": "scripts/deploy/ops-run.sh: apply-ops.sh puts the declared bundles online, then smoke.sh checks /healthz. Every run aligns every unit that ops/versions.json declares for the environment, because the concurrency group ops-deploy keeps one pending run and cancels the older one, so the units a cancelled run carried go online with the next run; a unit already online with the declared version and hashes is skipped. With --since every environment is aligned, and a unit that has settings in ops/workloads/ but no declared version is reported (\"<env> <unit> 沒有宣告版本,不部署\") and skipped, and when nothing is declared it ends with status 0. With --env the input units is only a hint that is printed",
2191
+ "wrangler": [
2192
+ "wrangler versions upload",
2193
+ "wrangler versions deploy <version id>@100 --env <env>",
2194
+ "wrangler triggers deploy --env <env>"
2195
+ ],
2196
+ "credentials": "The iac job reads CLOUDFLARE_R2_API_TOKEN (secret, the R2 write permission), CLOUDFLARE_ACCOUNT_ID (variable) and the state backend settings (TOFU_STATE_BUCKET and TOFU_STATE_ENDPOINT as variables, TOFU_STATE_ACCESS_KEY_ID and TOFU_STATE_SECRET_ACCESS_KEY as secrets). The workloads job reads CLOUDFLARE_API_TOKEN (secret, the permission of the Cloudflare template \"Edit Cloudflare Workers\", limited to the one account) and CLOUDFLARE_ACCOUNT_ID. Neither job reads the token of the other",
2197
+ "bundleToken": "The GitHub App token with contents: read on the repositories of the variable BUNDLE_REPOS, when it is set",
2198
+ "sources": [
2199
+ "https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/",
2200
+ "https://developers.cloudflare.com/workers/wrangler/commands/workers/",
2201
+ "https://developers.cloudflare.com/workers/wrangler/system-environment-variables/"
2202
+ ],
2203
+ "readOn": "2026-11-06",
2204
+ "enableCondition": "Neither job has an enable condition in the template. Only a demonstration repository has vars.DEPLOY_ENABLED == 'true' on both, added by compose, and the variable is unset there. A repository in real use does not carry it, and adds one only to control when deploying runs.",
2205
+ "runName": "run-name is `ops-deploy ${{ inputs.env || 'push' }}`: a workflow_dispatch run is named after its env input and a push run is `ops-deploy push`. A run list does not show the inputs of a dispatch, so the deploy gate of the release scripts reads the environment the run aligns from this name",
2206
+ "jobs": [
2207
+ "iac: on a GitHub-hosted runner, applies the iac steps of the environment (scripts/deploy/ops-run.sh --phase iac). It runs the steps in the order of ops/needs.json with apply-iac.sh, which stops before tofu init when a state backend setting is missing",
2208
+ "workloads: needs: iac, on the self-hosted runner, puts the declared bundles online and checks /healthz (scripts/deploy/ops-run.sh --phase workloads)"
2209
+ ],
2210
+ "moduleToken": "When the variable INFRA_MODULES_REPO is set, the iac job makes a GitHub App token for that repository (contents: read) and runs git config url.<base>.insteadOf with it before tofu init, so a main.tf with a git source on the private repository can be cloned",
2211
+ "unverified": "The real run of tofu init and tofu apply (the module fetch, the R2 backend and the provider) was not done. The jobs are tested against the stand-in of tofu in scripts/lib/",
2212
+ "prod": "The workflow deploys what is declared. Only deploy-prod.yml writes the prod declaration"
2213
+ }
2214
+ }
2124
2215
  }
2125
2216
  ],
2126
2217
  "source": {
@@ -2137,7 +2228,8 @@
2137
2228
  "steps": "scripts/deploy/ops-run.sh: apply-ops.sh puts the declared bundles online, then smoke.sh checks /healthz. Every run aligns every unit that ops/versions.json declares for the environment, because the concurrency group ops-deploy keeps one pending run and cancels the older one, so the units a cancelled run carried go online with the next run; a unit already online with the declared version and hashes is skipped. With --since every environment is aligned, and a unit that has settings in ops/workloads/ but no declared version is reported (\"<env> <unit> 沒有宣告版本,不部署\") and skipped, and when nothing is declared it ends with status 0. With --env the input units is only a hint that is printed",
2138
2229
  "wrangler": [
2139
2230
  "wrangler versions upload",
2140
- "wrangler versions deploy <version id>@100 --env <env>"
2231
+ "wrangler versions deploy <version id>@100 --env <env>",
2232
+ "wrangler triggers deploy --env <env>"
2141
2233
  ],
2142
2234
  "credentials": "The iac job reads CLOUDFLARE_R2_API_TOKEN (secret, the R2 write permission), CLOUDFLARE_ACCOUNT_ID (variable) and the state backend settings (TOFU_STATE_BUCKET and TOFU_STATE_ENDPOINT as variables, TOFU_STATE_ACCESS_KEY_ID and TOFU_STATE_SECRET_ACCESS_KEY as secrets). The workloads job reads CLOUDFLARE_API_TOKEN (secret, the permission of the Cloudflare template \"Edit Cloudflare Workers\", limited to the one account) and CLOUDFLARE_ACCOUNT_ID. Neither job reads the token of the other",
2143
2235
  "bundleToken": "The GitHub App token with contents: read on the repositories of the variable BUNDLE_REPOS, when it is set",
@@ -2332,6 +2424,34 @@
2332
2424
  ]
2333
2425
  }
2334
2426
  }
2427
+ },
2428
+ {
2429
+ "since": "0.11.0",
2430
+ "content": {
2431
+ "value": {
2432
+ "file": "deploy/scripts/deploy/route-tag.sh",
2433
+ "role": "deploy",
2434
+ "usage": "route-tag.sh <tag>",
2435
+ "output": [
2436
+ "unit",
2437
+ "version",
2438
+ "stage",
2439
+ "env",
2440
+ "kind (service|none)",
2441
+ "skip",
2442
+ "reason"
2443
+ ],
2444
+ "rules": [
2445
+ "a tag that is not {unit}/vX.Y.Z is skipped",
2446
+ "a stable tag is skipped: the product tag puts prod online",
2447
+ "a unit whose publish.to in release-policy.json is image is skipped, and the reason says that the unit publishes a container image and is not deployed by its tag (blueprint-shared.publishing.container-image)",
2448
+ "the environment is the target of the stage in release-policy.json, the unit's own targets first",
2449
+ "a unit of kind web, service or backend is routed by its directory: apps/ and services/ give kind=service, infra/ is skipped because the unit only publishes an interface (the cloud resources are created by the iac steps of ops), any other directory is skipped",
2450
+ "the unit deploys only when the stage has a target: release-policy.json is the only thing it reads, never the wrangler.toml of the unit. That ops has settings for the unit in the environment (ops/workloads/*/<env>/<unit>/) is checked by promote.sh, before the declaration is written",
2451
+ "every other kind is skipped, with its kind in the reason"
2452
+ ]
2453
+ }
2454
+ }
2335
2455
  }
2336
2456
  ],
2337
2457
  "source": {
@@ -2354,6 +2474,7 @@
2354
2474
  "rules": [
2355
2475
  "a tag that is not {unit}/vX.Y.Z is skipped",
2356
2476
  "a stable tag is skipped: the product tag puts prod online",
2477
+ "a unit whose publish.to in release-policy.json is image is skipped, and the reason says that the unit publishes a container image and is not deployed by its tag (blueprint-shared.publishing.container-image)",
2357
2478
  "the environment is the target of the stage in release-policy.json, the unit's own targets first",
2358
2479
  "a unit of kind web, service or backend is routed by its directory: apps/ and services/ give kind=service, infra/ is skipped because the unit only publishes an interface (the cloud resources are created by the iac steps of ops), any other directory is skipped",
2359
2480
  "the unit deploys only when the stage has a target: release-policy.json is the only thing it reads, never the wrangler.toml of the unit. That ops has settings for the unit in the environment (ops/workloads/*/<env>/<unit>/) is checked by promote.sh, before the declaration is written",
@@ -2604,7 +2725,7 @@
2604
2725
  "templates"
2605
2726
  ],
2606
2727
  "title": "apply-ops.sh 範本",
2607
- "description": "依宣告與 lock 下載 bundle、核對雜湊,把 ops 該環境的設定接在 bundle 的 `wrangler.toml` 後面,`wrangler versions upload` 再 `versions deploy <id>@100`。照 `ops/needs.json` 對步驟目錄依相依拓撲排序,有環就報錯。",
2728
+ "description": "依宣告與 lock 下載 bundle、核對雜湊,把 ops 該環境的設定接在 bundle 的 `wrangler.toml` 後面,`wrangler versions upload` 再 `versions deploy <id>@100`,最後 `wrangler triggers deploy` 套用路由、Custom Domain 與 workers_dev。照 `ops/needs.json` 對步驟目錄依相依拓撲排序,有環就報錯。",
2608
2729
  "variants": [
2609
2730
  {
2610
2731
  "since": "0.1.0",
@@ -2709,6 +2830,67 @@
2709
2830
  "iac": "The iac steps only take part in the order and in the cycle check here. They are applied by apply-iac.sh, which ops-run.sh runs first (scripts/lib/ops-steps.sh holds the order that both use)"
2710
2831
  }
2711
2832
  }
2833
+ },
2834
+ {
2835
+ "since": "0.11.0",
2836
+ "content": {
2837
+ "value": {
2838
+ "file": "ops/scripts/deploy/apply-ops.sh",
2839
+ "role": "ops",
2840
+ "usage": "apply-ops.sh <env> [--only unit1,unit2]",
2841
+ "perUnit": [
2842
+ "gh release download of the bundle that ops/versions.lock.json names",
2843
+ "stop when the hash of the downloaded bundle is not the one in the lock",
2844
+ "stop when the wrangler.toml of the bundle has an [env. table, and when ops/workloads/<purpose>/<env>/<unit>/wrangler.toml has a table that does not begin with [env.<env>]",
2845
+ "add bucket_name to every [[env.<env>.r2_buckets]] table of the file of ops that has none, in turn, with bucket_name from the terraform.tfvars.json of the iac steps that this step needs in ops/needs.json (iac/<purpose>/<env>/<name>). Too few names stop the run, and a table that carries its own bucket_name keeps it",
2846
+ "join the two: the file of ops, after a newline if the bundle's does not end with one, goes after the wrangler.toml of the bundle; the SHA-256 of the joined file is CONFIG_SHA256",
2847
+ "skip when /healthz already reports the declared version, the bundle hash and CONFIG_SHA256",
2848
+ "wrangler versions upload --env <env> --message \"<unit> <version> sha256:<hash>\" --var BUNDLE_SHA256:<hash> --var CONFIG_SHA256:<hash>, the id read from WRANGLER_OUTPUT_FILE_PATH",
2849
+ "wrangler versions deploy <id>@100 --env <env> --yes",
2850
+ "wrangler triggers deploy --env <env>, because versions deploy moves traffic only and does not apply the routes, custom domains or workers_dev of the settings; it changes nothing when they are in place"
2851
+ ],
2852
+ "order": "The steps are the directories <iac|workloads>/<purpose>/<env>/... of the environment (the iac steps that exist in ops/iac/ take part too), applied in the topological order of ops/needs.json, whose keys and values are step directories. A need on another environment or on hosts/ counts as applied. A unit it needs goes first, so the backend goes online before the front end. A step without an entry needs nothing. Units outside this run (--only) still take part in the order and in the cycle check",
2853
+ "cycle": "A cycle stops the run before any wrangler call, and the error names the steps on it, for example \"✗ 相依成環:workloads/edge/prod/a → workloads/edge/prod/b → workloads/edge/prod/a\" with exit status 1",
2854
+ "oneUnitRuns": "A prerelease run applies one unit, so the order has no effect there; a prod run applies every unit of the release and uses it",
2855
+ "env": [
2856
+ "WRANGLER (default `pnpm exec wrangler`)",
2857
+ "DEPLOY_LOG_DIR",
2858
+ "GH_TOKEN"
2859
+ ],
2860
+ "reads": [
2861
+ "ops/versions.json",
2862
+ "ops/versions.lock.json",
2863
+ "ops/needs.json",
2864
+ "ops/workloads/<purpose>/<env>/<unit>/wrangler.toml",
2865
+ "ops/iac/<purpose>/<env>/<name>/terraform.tfvars.json (bucket_name)",
2866
+ "ops/urls.json (through healthz.sh)"
2867
+ ],
2868
+ "commands": {
2869
+ "upload": {
2870
+ "command": "wrangler versions upload [dist/index.js --no-bundle] [--assets public] --env <env> --message \"<unit> <version> sha256:<hash>\" --var BUNDLE_SHA256:<hash>",
2871
+ "flags": "PATH is an entry point or a directory of static assets. --message labels the version, --var injects a key-value pair into the script, --assets names the static assets, --no-bundle uploads the Worker without the internal build. --env is a global flag of wrangler, not one of this command."
2872
+ },
2873
+ "deploy": {
2874
+ "command": "wrangler versions deploy <version-id>@100 --env <env> --yes --message \"<unit> <version>\"",
2875
+ "flags": "The version spec is <version-id>@<percentage>, and a missing percentage shares the rest of the traffic. --yes (-y) accepts the prompt defaults. --message describes the deployment. --env is a global flag."
2876
+ },
2877
+ "output": "WRANGLER_OUTPUT_FILE_PATH makes wrangler write one JSON object per line for commands such as version uploads, which is how the script reads the version id.",
2878
+ "credentials": "CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, from the workflow. The token template is \"Edit Cloudflare Workers\".",
2879
+ "triggers": {
2880
+ "command": "wrangler triggers deploy --env <env>",
2881
+ "flags": "Experimental. It applies the changes to the triggers (routes or domains and cron triggers) and workers_dev of the wrangler.toml in the working directory, which wrangler versions upload and wrangler versions deploy leave out. --env is a global flag."
2882
+ }
2883
+ },
2884
+ "sources": [
2885
+ "https://developers.cloudflare.com/workers/wrangler/commands/workers/",
2886
+ "https://developers.cloudflare.com/workers/wrangler/system-environment-variables/",
2887
+ "https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/"
2888
+ ],
2889
+ "readOn": "2026-11-06",
2890
+ "printed": "[apply-ops] <env> 套用順序:<step directories in order>",
2891
+ "iac": "The iac steps only take part in the order and in the cycle check here. They are applied by apply-iac.sh, which ops-run.sh runs first (scripts/lib/ops-steps.sh holds the order that both use)"
2892
+ }
2893
+ }
2712
2894
  }
2713
2895
  ],
2714
2896
  "source": {
@@ -2727,7 +2909,8 @@
2727
2909
  "join the two: the file of ops, after a newline if the bundle's does not end with one, goes after the wrangler.toml of the bundle; the SHA-256 of the joined file is CONFIG_SHA256",
2728
2910
  "skip when /healthz already reports the declared version, the bundle hash and CONFIG_SHA256",
2729
2911
  "wrangler versions upload --env <env> --message \"<unit> <version> sha256:<hash>\" --var BUNDLE_SHA256:<hash> --var CONFIG_SHA256:<hash>, the id read from WRANGLER_OUTPUT_FILE_PATH",
2730
- "wrangler versions deploy <id>@100 --env <env> --yes"
2912
+ "wrangler versions deploy <id>@100 --env <env> --yes",
2913
+ "wrangler triggers deploy --env <env>, because versions deploy moves traffic only and does not apply the routes, custom domains or workers_dev of the settings; it changes nothing when they are in place"
2731
2914
  ],
2732
2915
  "order": "The steps are the directories <iac|workloads>/<purpose>/<env>/... of the environment (the iac steps that exist in ops/iac/ take part too), applied in the topological order of ops/needs.json, whose keys and values are step directories. A need on another environment or on hosts/ counts as applied. A unit it needs goes first, so the backend goes online before the front end. A step without an entry needs nothing. Units outside this run (--only) still take part in the order and in the cycle check",
2733
2916
  "cycle": "A cycle stops the run before any wrangler call, and the error names the steps on it, for example \"✗ 相依成環:workloads/edge/prod/a → workloads/edge/prod/b → workloads/edge/prod/a\" with exit status 1",
@@ -2755,7 +2938,11 @@
2755
2938
  "flags": "The version spec is <version-id>@<percentage>, and a missing percentage shares the rest of the traffic. --yes (-y) accepts the prompt defaults. --message describes the deployment. --env is a global flag."
2756
2939
  },
2757
2940
  "output": "WRANGLER_OUTPUT_FILE_PATH makes wrangler write one JSON object per line for commands such as version uploads, which is how the script reads the version id.",
2758
- "credentials": "CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, from the workflow. The token template is \"Edit Cloudflare Workers\"."
2941
+ "credentials": "CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, from the workflow. The token template is \"Edit Cloudflare Workers\".",
2942
+ "triggers": {
2943
+ "command": "wrangler triggers deploy --env <env>",
2944
+ "flags": "Experimental. It applies the changes to the triggers (routes or domains and cron triggers) and workers_dev of the wrangler.toml in the working directory, which wrangler versions upload and wrangler versions deploy leave out. --env is a global flag."
2945
+ }
2759
2946
  },
2760
2947
  "sources": [
2761
2948
  "https://developers.cloudflare.com/workers/wrangler/commands/workers/",
@@ -8773,6 +8960,62 @@
8773
8960
  }
8774
8961
  }
8775
8962
  }
8963
+ },
8964
+ {
8965
+ "since": "0.11.0",
8966
+ "content": {
8967
+ "value": {
8968
+ "pattern": "<ProductName> or <ProductName><suffix> for a repository of the product layer; its own name for a repository of the organization layer",
8969
+ "suffixes": [
8970
+ "-hub",
8971
+ "-app",
8972
+ "-service",
8973
+ "-pkg",
8974
+ "-ops",
8975
+ "-infra"
8976
+ ],
8977
+ "suffixMeaning": {
8978
+ "-hub": "holds the product version, the Release Plan and the product-level facts and docs of a product split over several repositories",
8979
+ "-app": "deployable front ends and clients",
8980
+ "-service": "deployable back-end services",
8981
+ "-pkg": "packages published to a registry",
8982
+ "-ops": "the configuration repository of the product: declares and applies its cloud resources and workloads, and holds which version runs in each environment",
8983
+ "-infra": "capability interfaces only, see blueprint-shared.naming.unit-name (InfraName). Cloud resources are declared and applied in the -ops repository"
8984
+ },
8985
+ "mirror": {
8986
+ "pattern": "<UnitName>",
8987
+ "meaning": "A public mirror repository that publishes one Go or Swift unit is named after that unit.",
8988
+ "examples": [
8989
+ "acme-sdk-go",
8990
+ "acme-sdk-swift",
8991
+ "orbit-sdk-go"
8992
+ ]
8993
+ },
8994
+ "examples": [
8995
+ "acme",
8996
+ "orbit-hub",
8997
+ "orbit-pkg"
8998
+ ],
8999
+ "layer": {
9000
+ "field": "layer",
9001
+ "values": [
9002
+ "organization",
9003
+ "product"
9004
+ ],
9005
+ "default": "product",
9006
+ "writtenIn": "the entry of the repository in a list of repositories that a naming check reads, and the top-level layer of its release-policy.json",
9007
+ "organization": "A repository of the organization layer belongs to no product: it serves every product. Its name is its own, not a ProductName and not a ProductName with a suffix. The organization layer has any number of repositories, for example a code repository, a configuration repository, and the repository that holds the templates (blueprint-shared.templates.org-role). Their names are not used as a prefix of any unit",
9008
+ "product": "A repository of the product layer is named after the product as the pattern says",
9009
+ "examples": [
9010
+ "fleet",
9011
+ "fleet-config"
9012
+ ]
9013
+ },
9014
+ "binaryRelease": {
9015
+ "meaning": "The public repository that receives the executable releases and the formula of the units whose publish.to is binary is named by the organization value binaryReleaseRepository (blueprint-shared.publishing.binary-release), as a repository name without the owner, and it has the same owner as the source repository. Its name is its own, not a ProductName with a suffix and not the name of a unit."
9016
+ }
9017
+ }
9018
+ }
8776
9019
  }
8777
9020
  ],
8778
9021
  "source": {
@@ -8825,6 +9068,9 @@
8825
9068
  "fleet",
8826
9069
  "fleet-config"
8827
9070
  ]
9071
+ },
9072
+ "binaryRelease": {
9073
+ "meaning": "The public repository that receives the executable releases and the formula of the units whose publish.to is binary is named by the organization value binaryReleaseRepository (blueprint-shared.publishing.binary-release), as a repository name without the owner, and it has the same owner as the source repository. Its name is its own, not a ProductName with a suffix and not the name of a unit."
8828
9074
  }
8829
9075
  }
8830
9076
  }
@@ -9986,49 +10232,152 @@
9986
10232
  "additionalProperties": false
9987
10233
  }
9988
10234
  }
9989
- }
9990
- ],
9991
- "source": {
9992
- "kind": "published"
9993
- },
9994
- "content": {
9995
- "schema": {
9996
- "type": "object",
9997
- "description": "The values an organization gives for the facts of blueprint-shared that list field names in `orgValues`. Every field a shared fact lists is a property here, and no other field is allowed.",
9998
- "properties": {
9999
- "mergeBotApp": {
10000
- "type": "string",
10001
- "description": "The name of the GitHub App whose installation token the auto-merge workflow uses (blueprint-shared.merge.token)."
10002
- },
10003
- "privateRepoRunner": {
10004
- "type": "string",
10005
- "description": "The kind of runner that the build and deploy jobs of a private repository run on, for example self-hosted."
10006
- },
10007
- "selfHostedRunnerLabels": {
10235
+ },
10236
+ {
10237
+ "since": "0.11.0",
10238
+ "content": {
10239
+ "schema": {
10008
10240
  "type": "object",
10009
- "description": "The runs-on labels of a self-hosted runner. Needed only when privateRepoRunner is self-hosted.",
10241
+ "description": "The values an organization gives for the facts of blueprint-shared that list field names in `orgValues`. Every field a shared fact lists is a property here, and no other field is allowed.",
10010
10242
  "properties": {
10011
- "default": {
10243
+ "mergeBotApp": {
10012
10244
  "type": "string",
10013
- "description": "The label of a job that has no special need, and of the build job of publish.yml."
10245
+ "description": "The name of the GitHub App whose installation token the auto-merge workflow uses (blueprint-shared.merge.token)."
10014
10246
  },
10015
- "docker": {
10247
+ "privateRepoRunner": {
10016
10248
  "type": "string",
10017
- "description": "The label of a job that needs docker."
10249
+ "description": "The kind of runner that the build and deploy jobs of a private repository run on, for example self-hosted."
10018
10250
  },
10019
- "swift": {
10020
- "type": "string",
10021
- "description": "The label of a swift job."
10022
- }
10023
- },
10024
- "required": [
10025
- "default"
10026
- ],
10027
- "additionalProperties": false
10028
- },
10029
- "githubPackagesPublishRunner": {
10030
- "type": "object",
10031
- "description": "The runner of the single job that publishes to GitHub Packages.",
10251
+ "selfHostedRunnerLabels": {
10252
+ "type": "object",
10253
+ "description": "The runs-on labels of a self-hosted runner. Needed only when privateRepoRunner is self-hosted.",
10254
+ "properties": {
10255
+ "default": {
10256
+ "type": "string",
10257
+ "description": "The label of a job that has no special need, of the build job and the binary job of publish.yml."
10258
+ },
10259
+ "docker": {
10260
+ "type": "string",
10261
+ "description": "The label of a job that needs docker, and of the image job of publish.yml. Without it the image job runs on the default label, and image-units.sh stops when that runner has no docker."
10262
+ },
10263
+ "swift": {
10264
+ "type": "string",
10265
+ "description": "The label of a swift job."
10266
+ }
10267
+ },
10268
+ "required": [
10269
+ "default"
10270
+ ],
10271
+ "additionalProperties": false
10272
+ },
10273
+ "githubPackagesPublishRunner": {
10274
+ "type": "object",
10275
+ "description": "The runner of the single job that publishes to GitHub Packages.",
10276
+ "properties": {
10277
+ "runner": {
10278
+ "type": "string",
10279
+ "description": "The kind of runner, for example self-hosted."
10280
+ },
10281
+ "label": {
10282
+ "type": "string",
10283
+ "description": "The runs-on label of the job, when the runner kind needs one."
10284
+ }
10285
+ },
10286
+ "required": [
10287
+ "runner"
10288
+ ],
10289
+ "additionalProperties": false
10290
+ },
10291
+ "privatePackageRegistry": {
10292
+ "type": "string",
10293
+ "description": "The registry that private packages are published to, for example github-packages."
10294
+ },
10295
+ "aggregatePackageName": {
10296
+ "type": "string",
10297
+ "description": "The package name of the facts aggregate package of the organization, with its scope when it has one. Omitted when the organization has no aggregate package."
10298
+ },
10299
+ "aggregateRegistry": {
10300
+ "type": "string",
10301
+ "description": "The registry that the facts aggregate package is published to. Omitted when the organization has no aggregate package."
10302
+ },
10303
+ "unscopedPublicPackages": {
10304
+ "type": "array",
10305
+ "description": "The packages the organization publishes without an npm scope, each one listed by name.",
10306
+ "items": {
10307
+ "type": "string"
10308
+ }
10309
+ },
10310
+ "expectedExclude": {
10311
+ "type": "array",
10312
+ "description": "The expected entries of minimumReleaseAgeExclude in pnpm-workspace.yaml. Optional, because the entries follow from the scope, the -facts suffix and unscopedPublicPackages.",
10313
+ "items": {
10314
+ "type": "string"
10315
+ }
10316
+ },
10317
+ "mergeBotUserId": {
10318
+ "type": "string",
10319
+ "pattern": "^[0-9]+$",
10320
+ "description": "The numeric user id of the bot account of the GitHub App named in mergeBotApp (gh api '/users/<mergeBotApp>[bot]' --jq .id). The deploy templates write it into the commit author <id>+<mergeBotApp>[bot] of writeback-ops.sh. Required when a repository has the role deploy."
10321
+ },
10322
+ "binaryReleaseRepository": {
10323
+ "type": "string",
10324
+ "pattern": "^[A-Za-z0-9._-]+$",
10325
+ "description": "The name of the public repository that receives the executable releases and the formula of the units whose publish.to is binary (blueprint-shared.publishing.binary-release). The repository name only, without the owner, and the owner is the same as that of the source repository. Optional: only a repository that has a binary unit fills it."
10326
+ }
10327
+ },
10328
+ "required": [
10329
+ "mergeBotApp",
10330
+ "privateRepoRunner",
10331
+ "githubPackagesPublishRunner",
10332
+ "privatePackageRegistry",
10333
+ "unscopedPublicPackages"
10334
+ ],
10335
+ "additionalProperties": false
10336
+ }
10337
+ }
10338
+ }
10339
+ ],
10340
+ "source": {
10341
+ "kind": "published"
10342
+ },
10343
+ "content": {
10344
+ "schema": {
10345
+ "type": "object",
10346
+ "description": "The values an organization gives for the facts of blueprint-shared that list field names in `orgValues`. Every field a shared fact lists is a property here, and no other field is allowed.",
10347
+ "properties": {
10348
+ "mergeBotApp": {
10349
+ "type": "string",
10350
+ "description": "The name of the GitHub App whose installation token the auto-merge workflow uses (blueprint-shared.merge.token)."
10351
+ },
10352
+ "privateRepoRunner": {
10353
+ "type": "string",
10354
+ "description": "The kind of runner that the build and deploy jobs of a private repository run on, for example self-hosted."
10355
+ },
10356
+ "selfHostedRunnerLabels": {
10357
+ "type": "object",
10358
+ "description": "The runs-on labels of a self-hosted runner. Needed only when privateRepoRunner is self-hosted.",
10359
+ "properties": {
10360
+ "default": {
10361
+ "type": "string",
10362
+ "description": "The label of a job that has no special need, of the build job and the binary job of publish.yml."
10363
+ },
10364
+ "docker": {
10365
+ "type": "string",
10366
+ "description": "The label of a job that needs docker, and of the image job of publish.yml. Without it the image job runs on the default label, and image-units.sh stops when that runner has no docker."
10367
+ },
10368
+ "swift": {
10369
+ "type": "string",
10370
+ "description": "The label of a swift job."
10371
+ }
10372
+ },
10373
+ "required": [
10374
+ "default"
10375
+ ],
10376
+ "additionalProperties": false
10377
+ },
10378
+ "githubPackagesPublishRunner": {
10379
+ "type": "object",
10380
+ "description": "The runner of the single job that publishes to GitHub Packages.",
10032
10381
  "properties": {
10033
10382
  "runner": {
10034
10383
  "type": "string",
@@ -10074,6 +10423,11 @@
10074
10423
  "type": "string",
10075
10424
  "pattern": "^[0-9]+$",
10076
10425
  "description": "The numeric user id of the bot account of the GitHub App named in mergeBotApp (gh api '/users/<mergeBotApp>[bot]' --jq .id). The deploy templates write it into the commit author <id>+<mergeBotApp>[bot] of writeback-ops.sh. Required when a repository has the role deploy."
10426
+ },
10427
+ "binaryReleaseRepository": {
10428
+ "type": "string",
10429
+ "pattern": "^[A-Za-z0-9._-]+$",
10430
+ "description": "The name of the public repository that receives the executable releases and the formula of the units whose publish.to is binary (blueprint-shared.publishing.binary-release). The repository name only, without the owner, and the owner is the same as that of the source repository. Optional: only a repository that has a binary unit fills it."
10077
10431
  }
10078
10432
  },
10079
10433
  "required": [
@@ -10116,6 +10470,29 @@
10116
10470
  "releasePleaseDispatch": "release/.github/workflows/release-please.yml dispatches publish.yml with the released paths under packages/, libs/, facts and docs. publish.yml leaves out a path that is not a unit to publish, for example a library without publishConfig."
10117
10471
  }
10118
10472
  }
10473
+ },
10474
+ {
10475
+ "since": "0.11.0",
10476
+ "content": {
10477
+ "value": {
10478
+ "role": "publish",
10479
+ "dir": "publish/",
10480
+ "needs": [
10481
+ "base",
10482
+ "release"
10483
+ ],
10484
+ "files": [
10485
+ ".github/workflows/publish.yml",
10486
+ "scripts/release/publish-units.sh",
10487
+ "scripts/release/binary-units.sh",
10488
+ "scripts/release/image-units.sh",
10489
+ "scripts/release/mirror-units.sh",
10490
+ "scripts/release/cleanup-private-packages.mjs"
10491
+ ],
10492
+ "roleOf": "A repository has the role when something is published from it: a unit with a publish target, which is a unit whose publish.to is binary or image or a unit whose files give a target, or the facts or docs aggregate package. A unit whose publish.to is none has no publish target. The compose step refuses roles and units that disagree, the way it does for the release role.",
10493
+ "releasePleaseDispatch": "release/.github/workflows/release-please.yml dispatches publish.yml with the released paths under packages/, libs/, facts and docs, and the paths of the units whose publish.to is binary or image. publish.yml leaves out a path that is not a unit to publish, for example a library without publishConfig."
10494
+ }
10495
+ }
10119
10496
  }
10120
10497
  ],
10121
10498
  "source": {
@@ -10132,11 +10509,13 @@
10132
10509
  "files": [
10133
10510
  ".github/workflows/publish.yml",
10134
10511
  "scripts/release/publish-units.sh",
10512
+ "scripts/release/binary-units.sh",
10513
+ "scripts/release/image-units.sh",
10135
10514
  "scripts/release/mirror-units.sh",
10136
10515
  "scripts/release/cleanup-private-packages.mjs"
10137
10516
  ],
10138
- "roleOf": "A repository has the role when something is published from it: a unit with a publish target, or the facts or docs aggregate package. The compose step refuses roles and units that disagree, the way it does for the release role.",
10139
- "releasePleaseDispatch": "release/.github/workflows/release-please.yml dispatches publish.yml with the released paths under packages/, libs/, facts and docs. publish.yml leaves out a path that is not a unit to publish, for example a library without publishConfig."
10517
+ "roleOf": "A repository has the role when something is published from it: a unit with a publish target, which is a unit whose publish.to is binary or image or a unit whose files give a target, or the facts or docs aggregate package. A unit whose publish.to is none has no publish target. The compose step refuses roles and units that disagree, the way it does for the release role.",
10518
+ "releasePleaseDispatch": "release/.github/workflows/release-please.yml dispatches publish.yml with the released paths under packages/, libs/, facts and docs, and the paths of the units whose publish.to is binary or image. publish.yml leaves out a path that is not a unit to publish, for example a library without publishConfig."
10140
10519
  }
10141
10520
  }
10142
10521
  },
@@ -10479,120 +10858,293 @@
10479
10858
  "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
10480
10859
  }
10481
10860
  }
10482
- }
10483
- ],
10484
- "source": {
10485
- "kind": "published"
10486
- },
10487
- "content": {
10488
- "value": {
10489
- "file": "publish/.github/workflows/publish.yml",
10490
- "role": "publish",
10491
- "triggers": [
10492
- "workflow_dispatch"
10493
- ],
10494
- "inputs": [
10495
- {
10496
- "name": "paths",
10497
- "meaning": "JSON array of released unit paths"
10498
- },
10499
- {
10500
- "name": "stage",
10501
- "meaning": "alpha, beta, rc or ga; every unit version must belong to it"
10502
- },
10503
- {
10504
- "name": "dry_run",
10505
- "meaning": "every publishing job prints the commands it would run and writes nothing"
10506
- }
10507
- ],
10508
- "jobs": [
10509
- {
10510
- "id": "plan",
10511
- "runner": "self-hosted",
10512
- "does": "picks the units to publish and their targets, and runs every check that writes nothing"
10513
- },
10514
- {
10515
- "id": "build",
10516
- "runner": "self-hosted",
10517
- "does": "packs npm tarballs and PyPI distributions, verifies the crate, uploads them with retention-days 1",
10518
- "permissions": {
10519
- "contents": "read"
10520
- }
10521
- },
10522
- {
10523
- "id": "publish",
10524
- "runner": "ubuntu-latest",
10525
- "does": "Trusted Publishing to npm, PyPI and crates.io from the downloaded artifact",
10526
- "permissions": {
10527
- "contents": "read",
10528
- "id-token": "write"
10529
- },
10530
- "secrets": "none"
10531
- },
10532
- {
10533
- "id": "publish-github-packages",
10534
- "runner": "self-hosted",
10535
- "does": "packs and publishes the private packages in one job",
10536
- "permissions": {
10537
- "contents": "read",
10538
- "packages": "write"
10539
- },
10540
- "token": "GITHUB_TOKEN on the publish step only"
10541
- },
10542
- {
10543
- "id": "mirror",
10544
- "runner": "self-hosted",
10545
- "does": "pushes each Go and Swift unit to its mirror repository and tags it",
10546
- "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the mirror repositories, contents: write"
10547
- }
10548
- ],
10549
- "publicRepository": "In a public repository every runner label becomes ubuntu-latest when the repository is composed.",
10550
- "checkedBy": "the workflow checks of the repository: manual-only, tp-publish, tp-no-secrets and gh-packages",
10551
- "platformFacts": [
10552
- "npm.npm-trusted-publishing-runner",
10553
- "npm.npm-trusted-publishing-caller",
10554
- "npm.npm-trusted-publishing-workflow-filename",
10555
- "crates-io.cratesio-trusted-publishing-first-publish"
10556
- ],
10557
- "valuesFrom": [
10558
- "blueprint-shared.publishing.trusted-publishing",
10559
- "blueprint-shared.publishing.github-packages",
10560
- "blueprint-shared.publishing.go-swift-mirror",
10561
- "blueprint-shared.templates.github-app"
10562
- ],
10563
- "stepRequirements": [
10564
- {
10565
- "step": "rust-lang/crates-io-auth-action",
10566
- "needs": "id-token: write on the job; the crate already exists on crates.io; the step exposes the token as its output token and revokes it when the job ends (the later step passes it as CARGO_REGISTRY_TOKEN)"
10567
- },
10568
- {
10569
- "step": "npm and PyPI upload",
10570
- "needs": "id-token: write on the job and no npm or PyPI token; npm CLI 11.5.1 or later"
10571
- },
10572
- {
10573
- "step": "upload to GitHub Packages",
10574
- "needs": "permissions contents: read and packages: write on the job; NODE_AUTH_TOKEN set to secrets.GITHUB_TOKEN on the upload step only; setup-node with registry-url https://npm.pkg.github.com"
10575
- },
10576
- {
10577
- "step": "actions/create-github-app-token (mirror job)",
10578
- "needs": "client-id, private-key, owner, repositories (the mirror repositories) and permission-contents: write; the token is revoked when the job ends"
10579
- }
10580
- ],
10581
- "sources": [
10582
- "https://github.com/rust-lang/crates-io-auth-action",
10583
- "https://docs.npmjs.com/trusted-publishers",
10584
- "https://docs.pypi.org/trusted-publishers/using-a-publisher/",
10585
- "https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions",
10586
- "https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md",
10587
- "https://github.com/actions/create-github-app-token"
10588
- ],
10589
- "readOn": "2026-11-06",
10590
- "enableCondition": "The build, publish, publish-github-packages and mirror jobs have only their own plan condition (needs.plan.outputs.tp, github-packages or mirror) in the template. The plan job has none: it only checks and keeps the run from having no job that runs. Only a demonstration repository has vars.PUBLISH_ENABLED == 'true' after the plan condition of each of the four jobs, added by compose, and the variable is unset there so none of these jobs runs. A repository in real use does not carry the condition, and adds one only to control when publishing runs.",
10591
- "mirrorConcurrency": "The mirror job keeps the concurrency group mirror (one writer at a time, no cancel-in-progress). The group keeps one pending run and cancels an older pending one, so a run can be cancelled before it mirrors its version. The next run makes it up, because mirror-units.sh mirrors every version the mirror lacks, not only the version of its own checkout",
10592
- "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
10593
- }
10594
- }
10595
- },
10861
+ },
10862
+ {
10863
+ "since": "0.11.0",
10864
+ "content": {
10865
+ "value": {
10866
+ "file": "publish/.github/workflows/publish.yml",
10867
+ "role": "publish",
10868
+ "triggers": [
10869
+ "workflow_dispatch"
10870
+ ],
10871
+ "inputs": [
10872
+ {
10873
+ "name": "paths",
10874
+ "meaning": "JSON array of released unit paths"
10875
+ },
10876
+ {
10877
+ "name": "stage",
10878
+ "meaning": "alpha, beta, rc or ga; every unit version must belong to it"
10879
+ },
10880
+ {
10881
+ "name": "dry_run",
10882
+ "meaning": "every publishing job prints the commands it would run and writes nothing"
10883
+ }
10884
+ ],
10885
+ "jobs": [
10886
+ {
10887
+ "id": "plan",
10888
+ "runner": "self-hosted",
10889
+ "does": "picks the units to publish and their targets, and runs every check that writes nothing"
10890
+ },
10891
+ {
10892
+ "id": "build",
10893
+ "runner": "self-hosted",
10894
+ "does": "packs npm tarballs and PyPI distributions, verifies the crate, uploads them with retention-days 1",
10895
+ "permissions": {
10896
+ "contents": "read"
10897
+ }
10898
+ },
10899
+ {
10900
+ "id": "publish",
10901
+ "runner": "ubuntu-latest",
10902
+ "does": "Trusted Publishing to npm, PyPI and crates.io from the downloaded artifact",
10903
+ "permissions": {
10904
+ "contents": "read",
10905
+ "id-token": "write"
10906
+ },
10907
+ "secrets": "none"
10908
+ },
10909
+ {
10910
+ "id": "publish-github-packages",
10911
+ "runner": "self-hosted",
10912
+ "does": "packs and publishes the private packages in one job",
10913
+ "permissions": {
10914
+ "contents": "read",
10915
+ "packages": "write"
10916
+ },
10917
+ "token": "GITHUB_TOKEN on the publish step only"
10918
+ },
10919
+ {
10920
+ "id": "mirror",
10921
+ "runner": "self-hosted",
10922
+ "does": "pushes each Go and Swift unit to its mirror repository and tags it",
10923
+ "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the mirror repositories, contents: write"
10924
+ },
10925
+ {
10926
+ "id": "binary",
10927
+ "runner": "the default label of selfHostedRunnerLabels",
10928
+ "does": "cross-compiles each unit whose publish.to is binary, releases the archives and the checksum file to the repository of binaryReleaseRepository, and updates the formula at a GA version (blueprint-shared.publishing.binary-release)",
10929
+ "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the repository of binaryReleaseRepository, permission-contents: write"
10930
+ },
10931
+ {
10932
+ "id": "image",
10933
+ "runner": "the docker label of selfHostedRunnerLabels, a placeholder in the template (field dockerRunnerLabel of blueprint-shared.templates.fields)",
10934
+ "does": "builds and pushes the container image of each unit whose publish.to is image, and attaches the digest to the Release of the unit tag (blueprint-shared.publishing.container-image)",
10935
+ "permissions": {
10936
+ "contents": "write",
10937
+ "packages": "write"
10938
+ },
10939
+ "token": "GITHUB_TOKEN of the job"
10940
+ }
10941
+ ],
10942
+ "publicRepository": "In a public repository every runner label becomes ubuntu-latest when the repository is composed.",
10943
+ "checkedBy": "the workflow checks of the repository: manual-only, tp-publish, tp-no-secrets and gh-packages",
10944
+ "platformFacts": [
10945
+ "npm.npm-trusted-publishing-runner",
10946
+ "npm.npm-trusted-publishing-caller",
10947
+ "npm.npm-trusted-publishing-workflow-filename",
10948
+ "crates-io.cratesio-trusted-publishing-first-publish"
10949
+ ],
10950
+ "valuesFrom": [
10951
+ "blueprint-shared.publishing.trusted-publishing",
10952
+ "blueprint-shared.publishing.github-packages",
10953
+ "blueprint-shared.publishing.go-swift-mirror",
10954
+ "blueprint-shared.publishing.target-selection",
10955
+ "blueprint-shared.publishing.binary-release",
10956
+ "blueprint-shared.publishing.container-image",
10957
+ "blueprint-shared.templates.github-app"
10958
+ ],
10959
+ "stepRequirements": [
10960
+ {
10961
+ "step": "rust-lang/crates-io-auth-action",
10962
+ "needs": "id-token: write on the job; the crate already exists on crates.io; the step exposes the token as its output token and revokes it when the job ends (the later step passes it as CARGO_REGISTRY_TOKEN)"
10963
+ },
10964
+ {
10965
+ "step": "npm and PyPI upload",
10966
+ "needs": "id-token: write on the job and no npm or PyPI token; npm CLI 11.5.1 or later"
10967
+ },
10968
+ {
10969
+ "step": "upload to GitHub Packages",
10970
+ "needs": "permissions contents: read and packages: write on the job; NODE_AUTH_TOKEN set to secrets.GITHUB_TOKEN on the upload step only; setup-node with registry-url https://npm.pkg.github.com"
10971
+ },
10972
+ {
10973
+ "step": "actions/create-github-app-token (mirror job)",
10974
+ "needs": "client-id, private-key, owner, repositories (the mirror repositories) and permission-contents: write; the token is revoked when the job ends"
10975
+ },
10976
+ {
10977
+ "step": "actions/create-github-app-token (binary job)",
10978
+ "needs": "client-id, private-key, owner, repositories (only the repository of binaryReleaseRepository) and permission-contents: write; the token is revoked when the job ends"
10979
+ },
10980
+ {
10981
+ "step": "actions/setup-go (binary job)",
10982
+ "needs": "the Go version that go.mod of the unit names"
10983
+ },
10984
+ {
10985
+ "step": "push of the image (image job)",
10986
+ "needs": "permissions contents: write and packages: write on the job and the GITHUB_TOKEN of the job; DOCKER_CONFIG in the temporary directory of the job"
10987
+ }
10988
+ ],
10989
+ "sources": [
10990
+ "https://github.com/rust-lang/crates-io-auth-action",
10991
+ "https://docs.npmjs.com/trusted-publishers",
10992
+ "https://docs.pypi.org/trusted-publishers/using-a-publisher/",
10993
+ "https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions",
10994
+ "https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md",
10995
+ "https://github.com/actions/create-github-app-token"
10996
+ ],
10997
+ "readOn": "2026-11-06",
10998
+ "enableCondition": "The build, publish, publish-github-packages, mirror, binary and image jobs have only their own plan condition (needs.plan.outputs.tp, github-packages, mirror, binary or image) in the template. The plan job has none: it only checks and keeps the run from having no job that runs. Only a demonstration repository has vars.PUBLISH_ENABLED == 'true' after the plan condition of each of the six jobs, added by compose (scripts/compose/enable-conditions.mjs), and the variable is unset there so none of these jobs runs. A repository in real use does not carry the condition, and adds one only to control when publishing runs.",
10999
+ "mirrorConcurrency": "The mirror job keeps the concurrency group mirror (one writer at a time, no cancel-in-progress). The group keeps one pending run and cancels an older pending one, so a run can be cancelled before it mirrors its version. The next run makes it up, because mirror-units.sh mirrors every version the mirror lacks, not only the version of its own checkout",
11000
+ "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
11001
+ }
11002
+ }
11003
+ }
11004
+ ],
11005
+ "source": {
11006
+ "kind": "published"
11007
+ },
11008
+ "content": {
11009
+ "value": {
11010
+ "file": "publish/.github/workflows/publish.yml",
11011
+ "role": "publish",
11012
+ "triggers": [
11013
+ "workflow_dispatch"
11014
+ ],
11015
+ "inputs": [
11016
+ {
11017
+ "name": "paths",
11018
+ "meaning": "JSON array of released unit paths"
11019
+ },
11020
+ {
11021
+ "name": "stage",
11022
+ "meaning": "alpha, beta, rc or ga; every unit version must belong to it"
11023
+ },
11024
+ {
11025
+ "name": "dry_run",
11026
+ "meaning": "every publishing job prints the commands it would run and writes nothing"
11027
+ }
11028
+ ],
11029
+ "jobs": [
11030
+ {
11031
+ "id": "plan",
11032
+ "runner": "self-hosted",
11033
+ "does": "picks the units to publish and their targets, and runs every check that writes nothing"
11034
+ },
11035
+ {
11036
+ "id": "build",
11037
+ "runner": "self-hosted",
11038
+ "does": "packs npm tarballs and PyPI distributions, verifies the crate, uploads them with retention-days 1",
11039
+ "permissions": {
11040
+ "contents": "read"
11041
+ }
11042
+ },
11043
+ {
11044
+ "id": "publish",
11045
+ "runner": "ubuntu-latest",
11046
+ "does": "Trusted Publishing to npm, PyPI and crates.io from the downloaded artifact",
11047
+ "permissions": {
11048
+ "contents": "read",
11049
+ "id-token": "write"
11050
+ },
11051
+ "secrets": "none"
11052
+ },
11053
+ {
11054
+ "id": "publish-github-packages",
11055
+ "runner": "self-hosted",
11056
+ "does": "packs and publishes the private packages in one job",
11057
+ "permissions": {
11058
+ "contents": "read",
11059
+ "packages": "write"
11060
+ },
11061
+ "token": "GITHUB_TOKEN on the publish step only"
11062
+ },
11063
+ {
11064
+ "id": "mirror",
11065
+ "runner": "self-hosted",
11066
+ "does": "pushes each Go and Swift unit to its mirror repository and tags it",
11067
+ "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the mirror repositories, contents: write"
11068
+ },
11069
+ {
11070
+ "id": "binary",
11071
+ "runner": "the default label of selfHostedRunnerLabels",
11072
+ "does": "cross-compiles each unit whose publish.to is binary, releases the archives and the checksum file to the repository of binaryReleaseRepository, and updates the formula at a GA version (blueprint-shared.publishing.binary-release)",
11073
+ "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the repository of binaryReleaseRepository, permission-contents: write"
11074
+ },
11075
+ {
11076
+ "id": "image",
11077
+ "runner": "the docker label of selfHostedRunnerLabels, a placeholder in the template (field dockerRunnerLabel of blueprint-shared.templates.fields)",
11078
+ "does": "builds and pushes the container image of each unit whose publish.to is image, and attaches the digest to the Release of the unit tag (blueprint-shared.publishing.container-image)",
11079
+ "permissions": {
11080
+ "contents": "write",
11081
+ "packages": "write"
11082
+ },
11083
+ "token": "GITHUB_TOKEN of the job"
11084
+ }
11085
+ ],
11086
+ "publicRepository": "In a public repository every runner label becomes ubuntu-latest when the repository is composed.",
11087
+ "checkedBy": "the workflow checks of the repository: manual-only, tp-publish, tp-no-secrets and gh-packages",
11088
+ "platformFacts": [
11089
+ "npm.npm-trusted-publishing-runner",
11090
+ "npm.npm-trusted-publishing-caller",
11091
+ "npm.npm-trusted-publishing-workflow-filename",
11092
+ "crates-io.cratesio-trusted-publishing-first-publish"
11093
+ ],
11094
+ "valuesFrom": [
11095
+ "blueprint-shared.publishing.trusted-publishing",
11096
+ "blueprint-shared.publishing.github-packages",
11097
+ "blueprint-shared.publishing.go-swift-mirror",
11098
+ "blueprint-shared.publishing.target-selection",
11099
+ "blueprint-shared.publishing.binary-release",
11100
+ "blueprint-shared.publishing.container-image",
11101
+ "blueprint-shared.templates.github-app"
11102
+ ],
11103
+ "stepRequirements": [
11104
+ {
11105
+ "step": "rust-lang/crates-io-auth-action",
11106
+ "needs": "id-token: write on the job; the crate already exists on crates.io; the step exposes the token as its output token and revokes it when the job ends (the later step passes it as CARGO_REGISTRY_TOKEN)"
11107
+ },
11108
+ {
11109
+ "step": "npm and PyPI upload",
11110
+ "needs": "id-token: write on the job and no npm or PyPI token; npm CLI 11.5.1 or later"
11111
+ },
11112
+ {
11113
+ "step": "upload to GitHub Packages",
11114
+ "needs": "permissions contents: read and packages: write on the job; NODE_AUTH_TOKEN set to secrets.GITHUB_TOKEN on the upload step only; setup-node with registry-url https://npm.pkg.github.com"
11115
+ },
11116
+ {
11117
+ "step": "actions/create-github-app-token (mirror job)",
11118
+ "needs": "client-id, private-key, owner, repositories (the mirror repositories) and permission-contents: write; the token is revoked when the job ends"
11119
+ },
11120
+ {
11121
+ "step": "actions/create-github-app-token (binary job)",
11122
+ "needs": "client-id, private-key, owner, repositories (only the repository of binaryReleaseRepository) and permission-contents: write; the token is revoked when the job ends"
11123
+ },
11124
+ {
11125
+ "step": "actions/setup-go (binary job)",
11126
+ "needs": "the Go version that go.mod of the unit names"
11127
+ },
11128
+ {
11129
+ "step": "push of the image (image job)",
11130
+ "needs": "permissions contents: write and packages: write on the job and the GITHUB_TOKEN of the job; DOCKER_CONFIG in the temporary directory of the job"
11131
+ }
11132
+ ],
11133
+ "sources": [
11134
+ "https://github.com/rust-lang/crates-io-auth-action",
11135
+ "https://docs.npmjs.com/trusted-publishers",
11136
+ "https://docs.pypi.org/trusted-publishers/using-a-publisher/",
11137
+ "https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions",
11138
+ "https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md",
11139
+ "https://github.com/actions/create-github-app-token"
11140
+ ],
11141
+ "readOn": "2026-11-06",
11142
+ "enableCondition": "The build, publish, publish-github-packages, mirror, binary and image jobs have only their own plan condition (needs.plan.outputs.tp, github-packages, mirror, binary or image) in the template. The plan job has none: it only checks and keeps the run from having no job that runs. Only a demonstration repository has vars.PUBLISH_ENABLED == 'true' after the plan condition of each of the six jobs, added by compose (scripts/compose/enable-conditions.mjs), and the variable is unset there so none of these jobs runs. A repository in real use does not carry the condition, and adds one only to control when publishing runs.",
11143
+ "mirrorConcurrency": "The mirror job keeps the concurrency group mirror (one writer at a time, no cancel-in-progress). The group keeps one pending run and cancels an older pending one, so a run can be cancelled before it mirrors its version. The next run makes it up, because mirror-units.sh mirrors every version the mirror lacks, not only the version of its own checkout",
11144
+ "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
11145
+ }
11146
+ }
11147
+ },
10596
11148
  {
10597
11149
  "id": "blueprint-shared.templates.script.publish-units",
10598
11150
  "tool": "blueprint-shared",
@@ -10600,7 +11152,7 @@
10600
11152
  "templates"
10601
11153
  ],
10602
11154
  "title": "publish-units.sh 範本",
10603
- "description": "依單元的檔案決定發到 npm、GitHub Packages、PyPI、crates.io,或交給鏡像腳本。`PUBLISH_DRY_RUN=1` 只印要跑的指令,已發布的版本跳過,版號和階段不符就停下。",
11155
+ "description": "決定每個單元的發布目標並執行發布。`PUBLISH_DRY_RUN=1` 只印要跑的指令,已發布的版本跳過,版號和階段不符就停下。",
10604
11156
  "variants": [
10605
11157
  {
10606
11158
  "since": "0.1.0",
@@ -10829,14 +11381,137 @@
10829
11381
  "originAuth": "The checkouts of publish.yml keep no credential (persist-credentials: false), so the git commands that read the tags of origin (the ls-remote and fetch of the tag lookup, and the tag fetch of a Go or Swift unit) carry GH_TOKEN alone: an extra AUTHORIZATION header for GITHUB_SERVER_URL (default https://github.com) passed through GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0 and GIT_CONFIG_VALUE_0, written to no file and not in the arguments of git. Without GH_TOKEN the commands run without it. publish.yml gives GH_TOKEN: github.token to every step that runs publish-units.sh on units (Check every unit, the pack step, the Trusted Publishing upload, the GitHub Packages publish)"
10830
11382
  }
10831
11383
  }
10832
- }
10833
- ],
10834
- "source": {
10835
- "kind": "published"
10836
- },
10837
- "content": {
10838
- "value": {
10839
- "file": "publish/scripts/release/publish-units.sh",
11384
+ },
11385
+ {
11386
+ "since": "0.11.0",
11387
+ "content": {
11388
+ "value": {
11389
+ "file": "publish/scripts/release/publish-units.sh",
11390
+ "role": "publish",
11391
+ "usage": [
11392
+ "publish-units.sh [pack|upload] <alpha|beta|rc|ga> <path>...",
11393
+ "publish-units.sh --registries|--filter|--report|--mirrors|--crate-exists <path>..."
11394
+ ],
11395
+ "targetOfUnit": [
11396
+ {
11397
+ "file": "package.json",
11398
+ "publishConfig": "registry unset, or the public npm registry",
11399
+ "target": "npm",
11400
+ "registry": "the public npm registry"
11401
+ },
11402
+ {
11403
+ "file": "package.json",
11404
+ "publishConfig": "registry is the GitHub Packages npm registry",
11405
+ "target": "github-packages",
11406
+ "registry": "GitHub Packages"
11407
+ },
11408
+ {
11409
+ "file": "pyproject.toml",
11410
+ "target": "pypi",
11411
+ "registry": "pypi.org"
11412
+ },
11413
+ {
11414
+ "file": "Cargo.toml",
11415
+ "target": "crates",
11416
+ "registry": "crates.io"
11417
+ },
11418
+ {
11419
+ "file": "go.mod",
11420
+ "target": "go",
11421
+ "registry": "the mirror repository"
11422
+ },
11423
+ {
11424
+ "file": "Package.swift",
11425
+ "target": "swift",
11426
+ "registry": "the mirror repository"
11427
+ }
11428
+ ],
11429
+ "unitToPublish": "A package.json is a unit to publish when it has a publishConfig. Any other registry in publishConfig is refused. A unit whose publish.to is binary or image is a unit to publish, and a unit whose publish.to is none is not, whatever files it has.",
11430
+ "stageCheck": "The version of a unit must belong to the stage given (alpha, beta, rc, ga). A mismatch stops the run and names the version and the stage.",
11431
+ "distTag": {
11432
+ "alpha": "alpha",
11433
+ "beta": "beta",
11434
+ "rc": "rc",
11435
+ "ga": "latest",
11436
+ "rule": "only ga is latest"
11437
+ },
11438
+ "alreadyPublished": "A version the registry already has is skipped. A GitHub Packages version that exists with different dist/**/index.json stops the run.",
11439
+ "otherChecks": [
11440
+ "the unit file carries the version of .release-please-manifest.json",
11441
+ "the unit equals its tag <ComponentName>/v<version> when it has one"
11442
+ ],
11443
+ "dryRun": {
11444
+ "env": "PUBLISH_DRY_RUN=1",
11445
+ "output": "one line per unit: [dry-run] <target> <name>@<version> -> <registry> (<extra>): <command>",
11446
+ "skipped": "[skip] <target> <name>@<version> -> <registry>: <reason>",
11447
+ "effect": "nothing is packed, built or uploaded"
11448
+ },
11449
+ "env": [
11450
+ "PUBLISH_DRY_RUN",
11451
+ "PUBLISH_REGISTRIES",
11452
+ "PUBLISH_CHECK_ONLY",
11453
+ "PUBLISH_OUT",
11454
+ "MIRROR_OWNER",
11455
+ "GITHUB_REPOSITORY",
11456
+ "MIRROR_REMOTE",
11457
+ "GH_TOKEN",
11458
+ "GITHUB_SERVER_URL"
11459
+ ],
11460
+ "goSwift": "The script only checks a Go or Swift unit that has no publish.to and requires its unit tag. mirror-units.sh pushes it. --mirrors lists only these units.",
11461
+ "valuesFrom": [
11462
+ "blueprint-shared.publishing.methods",
11463
+ "blueprint-shared.publishing.trusted-publishing",
11464
+ "blueprint-shared.publishing.github-packages",
11465
+ "blueprint-shared.publishing.go-swift-mirror",
11466
+ "blueprint-shared.publishing.target-selection",
11467
+ "blueprint-shared.publishing.binary-release",
11468
+ "blueprint-shared.publishing.container-image"
11469
+ ],
11470
+ "planLog": {
11471
+ "mode": "--report <path>...",
11472
+ "line": "unit <path> -> <target>|not-published, one line per path and once for a path given twice. A unit to publish (the same test as --filter) prints its target (npm, github-packages, pypi, crates, go, swift, binary or image), any other path prints not-published, a unit whose publish.to is none included.",
11473
+ "where": "the reg step of the plan job in publish.yml, before --filter, so the log of the plan job says what happens to every dispatched path. A test that runs the workflow reads this log, because a job output cannot be read through the REST API.",
11474
+ "decision": "publish-plan-unit-log"
11475
+ },
11476
+ "crateMetadata": {
11477
+ "where": "pack_crates, before cargo publish --dry-run",
11478
+ "requires": [
11479
+ "description",
11480
+ "license or license-file"
11481
+ ],
11482
+ "onMissing": "The build step fails with a non-zero status. The message names the crate and lists every missing field, so the crate is refused here and not by the registry at the upload.",
11483
+ "source": "the Cargo manifest reference (doc.rust-lang.org, cargo/reference/manifest): crates.io requires the description to be set, and requires either license or license-file to be set",
11484
+ "templateDifference": "The template this one grew out of has no such check, its crates.io publish is simulated"
11485
+ },
11486
+ "commands": [
11487
+ "npm publish <tarball> --tag <dist-tag> [--access public] --registry <url>, once per tarball; the token is NODE_AUTH_TOKEN for GitHub Packages and the OIDC token for npm",
11488
+ "uv publish --trusted-publishing always --check-url <PyPI simple index URL> <wheel and sdist>",
11489
+ "cargo publish --locked --no-verify --manifest-path <Cargo.toml>, with CARGO_REGISTRY_TOKEN",
11490
+ "The flags, the credentials and the permissions of each command are in blueprint-shared.publishing.trusted-publishing and blueprint-shared.publishing.github-packages"
11491
+ ],
11492
+ "sources": [
11493
+ "https://docs.npmjs.com/cli/v11/commands/npm-publish",
11494
+ "https://docs.astral.sh/uv/reference/cli/",
11495
+ "https://doc.rust-lang.org/cargo/commands/cargo-publish.html",
11496
+ "https://doc.rust-lang.org/cargo/reference/config.html"
11497
+ ],
11498
+ "readOn": "2026-11-06",
11499
+ "tagLookup": "A shallow checkout fetches the unit tag before the content check, after asking the remote with git ls-remote --exit-code. Exit code 2 (the tag is not on the remote) means there is no tag to compare with and the check passes. Any other failure of git ls-remote or of the fetch stops the script and prints the error of git, so an unreachable remote or a bad credential is not read as no tag",
11500
+ "originAuth": "The checkouts of publish.yml keep no credential (persist-credentials: false), so the git commands that read the tags of origin (the ls-remote and fetch of the tag lookup, and the tag fetch of a Go or Swift unit) carry GH_TOKEN alone: an extra AUTHORIZATION header for GITHUB_SERVER_URL (default https://github.com) passed through GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0 and GIT_CONFIG_VALUE_0, written to no file and not in the arguments of git. Without GH_TOKEN the commands run without it. publish.yml gives GH_TOKEN: github.token to every step that runs publish-units.sh on units (Check every unit, the pack step, the Trusted Publishing upload, the GitHub Packages publish)",
11501
+ "policyFirst": "The script reads publish.to of the unit in release-policy.json before it looks at the files. A unit that has it takes its target from it (binary, image or none). A unit without it follows targetOfUnit (blueprint-shared.publishing.target-selection).",
11502
+ "binaryImage": "The binary target is done by binary-units.sh and the image target by image-units.sh (blueprint-shared.publishing.binary-release, blueprint-shared.publishing.container-image).",
11503
+ "registries": "--registries lists binary=true and image=true when the paths have a unit with that publish.to. A unit whose publish.to is none is left out of it.",
11504
+ "reportExit": "--report prints the line of every path it can tell, and a unit whose target cannot be told (publish.to binary without go.mod, publish.to image without a Dockerfile) prints its reason on stderr and has no line. The exit status is 1 after the last path."
11505
+ }
11506
+ }
11507
+ }
11508
+ ],
11509
+ "source": {
11510
+ "kind": "published"
11511
+ },
11512
+ "content": {
11513
+ "value": {
11514
+ "file": "publish/scripts/release/publish-units.sh",
10840
11515
  "role": "publish",
10841
11516
  "usage": [
10842
11517
  "publish-units.sh [pack|upload] <alpha|beta|rc|ga> <path>...",
@@ -10876,7 +11551,7 @@
10876
11551
  "registry": "the mirror repository"
10877
11552
  }
10878
11553
  ],
10879
- "unitToPublish": "A package.json is a unit to publish when it has a publishConfig. Any other registry in publishConfig is refused.",
11554
+ "unitToPublish": "A package.json is a unit to publish when it has a publishConfig. Any other registry in publishConfig is refused. A unit whose publish.to is binary or image is a unit to publish, and a unit whose publish.to is none is not, whatever files it has.",
10880
11555
  "stageCheck": "The version of a unit must belong to the stage given (alpha, beta, rc, ga). A mismatch stops the run and names the version and the stage.",
10881
11556
  "distTag": {
10882
11557
  "alpha": "alpha",
@@ -10907,16 +11582,19 @@
10907
11582
  "GH_TOKEN",
10908
11583
  "GITHUB_SERVER_URL"
10909
11584
  ],
10910
- "goSwift": "The script only checks a Go or Swift unit and requires its unit tag. mirror-units.sh pushes it.",
11585
+ "goSwift": "The script only checks a Go or Swift unit that has no publish.to and requires its unit tag. mirror-units.sh pushes it. --mirrors lists only these units.",
10911
11586
  "valuesFrom": [
10912
11587
  "blueprint-shared.publishing.methods",
10913
11588
  "blueprint-shared.publishing.trusted-publishing",
10914
11589
  "blueprint-shared.publishing.github-packages",
10915
- "blueprint-shared.publishing.go-swift-mirror"
11590
+ "blueprint-shared.publishing.go-swift-mirror",
11591
+ "blueprint-shared.publishing.target-selection",
11592
+ "blueprint-shared.publishing.binary-release",
11593
+ "blueprint-shared.publishing.container-image"
10916
11594
  ],
10917
11595
  "planLog": {
10918
11596
  "mode": "--report <path>...",
10919
- "line": "unit <path> -> <target>|not-published, one line per path and once for a path given twice. A unit to publish (the same test as --filter) prints its target (npm, github-packages, pypi, crates, go or swift), any other path prints not-published.",
11597
+ "line": "unit <path> -> <target>|not-published, one line per path and once for a path given twice. A unit to publish (the same test as --filter) prints its target (npm, github-packages, pypi, crates, go, swift, binary or image), any other path prints not-published, a unit whose publish.to is none included.",
10920
11598
  "where": "the reg step of the plan job in publish.yml, before --filter, so the log of the plan job says what happens to every dispatched path. A test that runs the workflow reads this log, because a job output cannot be read through the REST API.",
10921
11599
  "decision": "publish-plan-unit-log"
10922
11600
  },
@@ -10944,7 +11622,11 @@
10944
11622
  ],
10945
11623
  "readOn": "2026-11-06",
10946
11624
  "tagLookup": "A shallow checkout fetches the unit tag before the content check, after asking the remote with git ls-remote --exit-code. Exit code 2 (the tag is not on the remote) means there is no tag to compare with and the check passes. Any other failure of git ls-remote or of the fetch stops the script and prints the error of git, so an unreachable remote or a bad credential is not read as no tag",
10947
- "originAuth": "The checkouts of publish.yml keep no credential (persist-credentials: false), so the git commands that read the tags of origin (the ls-remote and fetch of the tag lookup, and the tag fetch of a Go or Swift unit) carry GH_TOKEN alone: an extra AUTHORIZATION header for GITHUB_SERVER_URL (default https://github.com) passed through GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0 and GIT_CONFIG_VALUE_0, written to no file and not in the arguments of git. Without GH_TOKEN the commands run without it. publish.yml gives GH_TOKEN: github.token to every step that runs publish-units.sh on units (Check every unit, the pack step, the Trusted Publishing upload, the GitHub Packages publish)"
11625
+ "originAuth": "The checkouts of publish.yml keep no credential (persist-credentials: false), so the git commands that read the tags of origin (the ls-remote and fetch of the tag lookup, and the tag fetch of a Go or Swift unit) carry GH_TOKEN alone: an extra AUTHORIZATION header for GITHUB_SERVER_URL (default https://github.com) passed through GIT_CONFIG_COUNT, GIT_CONFIG_KEY_0 and GIT_CONFIG_VALUE_0, written to no file and not in the arguments of git. Without GH_TOKEN the commands run without it. publish.yml gives GH_TOKEN: github.token to every step that runs publish-units.sh on units (Check every unit, the pack step, the Trusted Publishing upload, the GitHub Packages publish)",
11626
+ "policyFirst": "The script reads publish.to of the unit in release-policy.json before it looks at the files. A unit that has it takes its target from it (binary, image or none). A unit without it follows targetOfUnit (blueprint-shared.publishing.target-selection).",
11627
+ "binaryImage": "The binary target is done by binary-units.sh and the image target by image-units.sh (blueprint-shared.publishing.binary-release, blueprint-shared.publishing.container-image).",
11628
+ "registries": "--registries lists binary=true and image=true when the paths have a unit with that publish.to. A unit whose publish.to is none is left out of it.",
11629
+ "reportExit": "--report prints the line of every path it can tell, and a unit whose target cannot be told (publish.to binary without go.mod, publish.to image without a Dockerfile) prints its reason on stderr and has no line. The exit status is 1 after the last path."
10948
11630
  }
10949
11631
  }
10950
11632
  },
@@ -11575,6 +12257,46 @@
11575
12257
  "readOn": "2026-11-06"
11576
12258
  }
11577
12259
  }
12260
+ },
12261
+ {
12262
+ "since": "0.11.0",
12263
+ "content": {
12264
+ "value": {
12265
+ "why": "Go and Swift have no registry to publish to. The Go module proxy and SwiftPM read a public repository.",
12266
+ "mirrorRepository": {
12267
+ "visibility": "public",
12268
+ "name": "the UnitName of the unit it mirrors (blueprint-shared.naming.repo-name, field mirror)",
12269
+ "content": "The package directory of the unit is the root of the repository, pushed to main."
12270
+ },
12271
+ "tags": {
12272
+ "go": "v<X.Y.Z>",
12273
+ "swift": "<X.Y.Z>",
12274
+ "prerelease": "A prerelease keeps the suffix of the unit version, for example v0.3.0-alpha.2 for Go and 0.3.0-alpha.2 for Swift.",
12275
+ "conflict": "A tag that already exists with different content is refused."
12276
+ },
12277
+ "goModulePath": "github.com/<owner>/<mirror repository name>",
12278
+ "sourceTag": "The unit tag in the source repository stays <ComponentName>/v<version>.",
12279
+ "tagRules": {
12280
+ "go": "A module in the root of the repository has the tag vX.Y.Z, the same as its version. A module in a subdirectory needs the tag <subdirectory>/vX.Y.Z, which is why the mirror repository holds the unit directory as its root.",
12281
+ "swift": "SwiftPM reads git tags as semantic versions. A tag has all three components, major, minor and patch."
12282
+ },
12283
+ "push": {
12284
+ "command": "git push --atomic <remote> <sha>:refs/heads/main <sha>:refs/tags/<tag>, or git push <remote> <sha>:refs/tags/<tag> alone when only the tag is new",
12285
+ "flags": "--atomic updates every ref or none of them. A tag that does not exist yet is created. A tag that exists with another target is rejected unless the push is forced, and the script never forces. A branch only takes fast-forward updates.",
12286
+ "credential": "The GitHub App token is sent as an HTTP header (git -c http.extraheader=...), so it is in no URL. The git-config entry http.extraHeader adds a header to every request to the server.",
12287
+ "appToken": "actions/create-github-app-token with owner, repositories (the mirror repositories) and permission-contents: write. Without a permission input the token inherits every permission of the installation. The post step of the action revokes the token when the job ends."
12288
+ },
12289
+ "sources": [
12290
+ "https://go.dev/ref/mod",
12291
+ "https://github.com/swiftlang/swift-package-manager/blob/main/Sources/PackageManagerDocs/Documentation.docc/Dependencies/AddingDependencies.md",
12292
+ "https://git-scm.com/docs/git-push",
12293
+ "https://git-scm.com/docs/git-config",
12294
+ "https://github.com/actions/create-github-app-token"
12295
+ ],
12296
+ "readOn": "2026-11-06",
12297
+ "selection": "A Go or Swift unit goes to a mirror repository only when its release-policy.json entry has no publish.to. A Go unit with publish.to binary is published as executables (blueprint-shared.publishing.binary-release), and a unit with publish.to image or none is not mirrored (blueprint-shared.publishing.target-selection)."
12298
+ }
12299
+ }
11578
12300
  }
11579
12301
  ],
11580
12302
  "source": {
@@ -11613,7 +12335,8 @@
11613
12335
  "https://git-scm.com/docs/git-config",
11614
12336
  "https://github.com/actions/create-github-app-token"
11615
12337
  ],
11616
- "readOn": "2026-11-06"
12338
+ "readOn": "2026-11-06",
12339
+ "selection": "A Go or Swift unit goes to a mirror repository only when its release-policy.json entry has no publish.to. A Go unit with publish.to binary is published as executables (blueprint-shared.publishing.binary-release), and a unit with publish.to image or none is not mirrored (blueprint-shared.publishing.target-selection)."
11617
12340
  }
11618
12341
  }
11619
12342
  },
@@ -11677,6 +12400,77 @@
11677
12400
  ]
11678
12401
  }
11679
12402
  }
12403
+ },
12404
+ {
12405
+ "since": "0.11.0",
12406
+ "content": {
12407
+ "value": {
12408
+ "rows": [
12409
+ {
12410
+ "target": "npm",
12411
+ "visibility": "public",
12412
+ "method": "trusted-publishing",
12413
+ "runner": "github-hosted"
12414
+ },
12415
+ {
12416
+ "target": "pypi",
12417
+ "visibility": "public",
12418
+ "method": "trusted-publishing",
12419
+ "runner": "github-hosted"
12420
+ },
12421
+ {
12422
+ "target": "crates",
12423
+ "visibility": "public",
12424
+ "method": "trusted-publishing",
12425
+ "runner": "github-hosted"
12426
+ },
12427
+ {
12428
+ "target": "go",
12429
+ "visibility": "public",
12430
+ "method": "mirror-repository-tag",
12431
+ "tag": "v<X.Y.Z>",
12432
+ "runner": "follows blueprint-shared.ci.runners"
12433
+ },
12434
+ {
12435
+ "target": "swift",
12436
+ "visibility": "public",
12437
+ "method": "mirror-repository-tag",
12438
+ "tag": "<X.Y.Z>",
12439
+ "runner": "follows blueprint-shared.ci.runners"
12440
+ },
12441
+ {
12442
+ "target": "github-packages",
12443
+ "visibility": "private",
12444
+ "method": "GITHUB_TOKEN",
12445
+ "runner": "the runner the organization gives in githubPackagesPublishRunner, one job",
12446
+ "usedWhen": "privatePackageRegistry is github-packages"
12447
+ },
12448
+ {
12449
+ "target": "binary",
12450
+ "visibility": "public",
12451
+ "method": "github-release-and-formula",
12452
+ "tag": "<ComponentName>/v<version>",
12453
+ "runner": "the default label of selfHostedRunnerLabels",
12454
+ "usedWhen": "publish.to of the unit is binary (blueprint-shared.publishing.binary-release)"
12455
+ },
12456
+ {
12457
+ "target": "image",
12458
+ "visibility": "private at the first push",
12459
+ "method": "ghcr",
12460
+ "tag": "<version>",
12461
+ "runner": "the docker label of selfHostedRunnerLabels",
12462
+ "usedWhen": "publish.to of the unit is image (blueprint-shared.publishing.container-image)"
12463
+ }
12464
+ ],
12465
+ "orgValues": [
12466
+ "privatePackageRegistry",
12467
+ "githubPackagesPublishRunner",
12468
+ "binaryReleaseRepository",
12469
+ "selfHostedRunnerLabels"
12470
+ ],
12471
+ "selectedBy": "A unit may name its target with publish.to in release-policy.json (blueprint-shared.publishing.target-selection). Without it the target follows the files of the unit, as before."
12472
+ }
12473
+ }
11680
12474
  }
11681
12475
  ],
11682
12476
  "source": {
@@ -11723,12 +12517,31 @@
11723
12517
  "method": "GITHUB_TOKEN",
11724
12518
  "runner": "the runner the organization gives in githubPackagesPublishRunner, one job",
11725
12519
  "usedWhen": "privatePackageRegistry is github-packages"
12520
+ },
12521
+ {
12522
+ "target": "binary",
12523
+ "visibility": "public",
12524
+ "method": "github-release-and-formula",
12525
+ "tag": "<ComponentName>/v<version>",
12526
+ "runner": "the default label of selfHostedRunnerLabels",
12527
+ "usedWhen": "publish.to of the unit is binary (blueprint-shared.publishing.binary-release)"
12528
+ },
12529
+ {
12530
+ "target": "image",
12531
+ "visibility": "private at the first push",
12532
+ "method": "ghcr",
12533
+ "tag": "<version>",
12534
+ "runner": "the docker label of selfHostedRunnerLabels",
12535
+ "usedWhen": "publish.to of the unit is image (blueprint-shared.publishing.container-image)"
11726
12536
  }
11727
12537
  ],
11728
12538
  "orgValues": [
11729
12539
  "privatePackageRegistry",
11730
- "githubPackagesPublishRunner"
11731
- ]
12540
+ "githubPackagesPublishRunner",
12541
+ "binaryReleaseRepository",
12542
+ "selfHostedRunnerLabels"
12543
+ ],
12544
+ "selectedBy": "A unit may name its target with publish.to in release-policy.json (blueprint-shared.publishing.target-selection). Without it the target follows the files of the unit, as before."
11732
12545
  }
11733
12546
  }
11734
12547
  },
@@ -11802,23 +12615,57 @@
11802
12615
  }
11803
12616
  },
11804
12617
  {
11805
- "id": "blueprint-shared.release-policy.stage-selection-rule",
12618
+ "id": "blueprint-shared.publishing.target-selection",
11806
12619
  "tool": "blueprint-shared",
11807
12620
  "topics": [
11808
- "release-policy"
12621
+ "publishing"
11809
12622
  ],
11810
- "title": "發布階段的選擇規則",
12623
+ "title": "單元怎麼選發布目標",
12624
+ "description": "單元在政策檔用選填欄位 `publish.to` 選 `binary`、`image` 或 `none`。沒寫時照單元的檔案判斷,既有的 Go 函式庫照舊走鏡像倉。寫了就以它為準,`none` 表示不發布。",
11811
12625
  "variants": [
11812
12626
  {
11813
- "since": "0.1.0",
11814
- "content": {
11815
- "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元。預發布環境是 production 以外的部署環境,寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
11816
- }
11817
- },
11818
- {
11819
- "since": "0.4.0",
12627
+ "since": "0.11.0",
11820
12628
  "content": {
11821
- "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元。預發布環境是 `prod` 以外的部署環境(環境名見 `blueprint-shared.environments.names`),寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
12629
+ "value": {
12630
+ "field": "publish.to of a unit in release-policy.json (blueprint-shared.release-policy.unit-publish)",
12631
+ "values": [
12632
+ {
12633
+ "to": "binary",
12634
+ "meaning": "a compiled executable, released to the public release repository and the formula (blueprint-shared.publishing.binary-release)"
12635
+ },
12636
+ {
12637
+ "to": "image",
12638
+ "meaning": "a container image pushed to ghcr (blueprint-shared.publishing.container-image)"
12639
+ },
12640
+ {
12641
+ "to": "none",
12642
+ "meaning": "the unit is not published"
12643
+ }
12644
+ ],
12645
+ "notSet": "A unit without publish.to keeps the target that follows its files (blueprint-shared.publishing.methods), so a Go library is still published to a mirror repository.",
12646
+ "binary": {
12647
+ "kind": "package only",
12648
+ "requires": [
12649
+ "command",
12650
+ "description",
12651
+ "platforms"
12652
+ ],
12653
+ "language": "Go only. A unit without go.mod makes the policy check fail and the message names the reason."
12654
+ },
12655
+ "image": {
12656
+ "kind": "service or backend only",
12657
+ "requires": [
12658
+ "platforms"
12659
+ ],
12660
+ "targets": "The unit needs no targets, because it is not deployed by a tag."
12661
+ },
12662
+ "none": {
12663
+ "effect": "publishable() and --filter of publish-units.sh say no for the unit, and --report prints not-published for it."
12664
+ },
12665
+ "why": "Choosing by the files of the unit cannot say that a unit is not published, and cannot tell a published Go executable from another Go package main. A new kind is not added, because the kind decides the stages and the deployment, and where a unit is published is another matter.",
12666
+ "publishRole": "A unit whose publish.to is binary or image counts as a unit with a publish target, for the roleOf rule of the publish role (blueprint-shared.templates.publish-role).",
12667
+ "report": "publish-units.sh --report prints binary, image or not-published for the unit, and --registries lists binary=true and image=true when the paths have such a unit."
12668
+ }
11822
12669
  }
11823
12670
  }
11824
12671
  ],
@@ -11826,7 +12673,270 @@
11826
12673
  "kind": "published"
11827
12674
  },
11828
12675
  "content": {
11829
- "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元。預發布環境是 `prod` 以外的部署環境(環境名見 `blueprint-shared.environments.names`),寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
12676
+ "value": {
12677
+ "field": "publish.to of a unit in release-policy.json (blueprint-shared.release-policy.unit-publish)",
12678
+ "values": [
12679
+ {
12680
+ "to": "binary",
12681
+ "meaning": "a compiled executable, released to the public release repository and the formula (blueprint-shared.publishing.binary-release)"
12682
+ },
12683
+ {
12684
+ "to": "image",
12685
+ "meaning": "a container image pushed to ghcr (blueprint-shared.publishing.container-image)"
12686
+ },
12687
+ {
12688
+ "to": "none",
12689
+ "meaning": "the unit is not published"
12690
+ }
12691
+ ],
12692
+ "notSet": "A unit without publish.to keeps the target that follows its files (blueprint-shared.publishing.methods), so a Go library is still published to a mirror repository.",
12693
+ "binary": {
12694
+ "kind": "package only",
12695
+ "requires": [
12696
+ "command",
12697
+ "description",
12698
+ "platforms"
12699
+ ],
12700
+ "language": "Go only. A unit without go.mod makes the policy check fail and the message names the reason."
12701
+ },
12702
+ "image": {
12703
+ "kind": "service or backend only",
12704
+ "requires": [
12705
+ "platforms"
12706
+ ],
12707
+ "targets": "The unit needs no targets, because it is not deployed by a tag."
12708
+ },
12709
+ "none": {
12710
+ "effect": "publishable() and --filter of publish-units.sh say no for the unit, and --report prints not-published for it."
12711
+ },
12712
+ "why": "Choosing by the files of the unit cannot say that a unit is not published, and cannot tell a published Go executable from another Go package main. A new kind is not added, because the kind decides the stages and the deployment, and where a unit is published is another matter.",
12713
+ "publishRole": "A unit whose publish.to is binary or image counts as a unit with a publish target, for the roleOf rule of the publish role (blueprint-shared.templates.publish-role).",
12714
+ "report": "publish-units.sh --report prints binary, image or not-published for the unit, and --registries lists binary=true and image=true when the paths have such a unit."
12715
+ }
12716
+ }
12717
+ },
12718
+ {
12719
+ "id": "blueprint-shared.publishing.binary-release",
12720
+ "tool": "blueprint-shared",
12721
+ "topics": [
12722
+ "publishing"
12723
+ ],
12724
+ "title": "執行檔發到公開發布倉",
12725
+ "description": "`publish.to` 是 `binary` 的單元,依政策檔的平台交叉編譯,打成壓縮檔連同 checksum 發到組織值 `binaryReleaseRepository` 指定的公開倉。預發布只發 GitHub prerelease,GA 才更新 Homebrew formula。",
12726
+ "variants": [
12727
+ {
12728
+ "since": "0.11.0",
12729
+ "content": {
12730
+ "value": {
12731
+ "usedWhen": "publish.to of the unit is binary (blueprint-shared.publishing.target-selection)",
12732
+ "build": "Cross-compiles for each platform of the unit in the policy with CGO_ENABLED=0 and -trimpath -buildvcs=false, so the same source builds the same bytes at a different commit (Go writes the commit and its time into the executable by default). Go only.",
12733
+ "archive": "<command>-<version>-<os>-<arch>.tar.gz",
12734
+ "checksum": {
12735
+ "file": "<command>-<version>.sha256",
12736
+ "format": "sha256sum"
12737
+ },
12738
+ "version": "The unit has a version.txt, and the script checks that it equals the version of the manifest before it publishes. After the build it runs the --version of the executable of the runner platform and checks that it prints the same version.",
12739
+ "repository": {
12740
+ "orgValue": "binaryReleaseRepository",
12741
+ "value": "The repository name only, without the owner. The owner is the owner of the source repository.",
12742
+ "visibility": "public",
12743
+ "optional": "The organization value is optional. Only a repository that has a binary unit fills it.",
12744
+ "empty": "Without a value the binary job stops at its first step and writes the reason, before the App token is made, so an empty repositories list never widens the token."
12745
+ },
12746
+ "rerun": "A release that exists with the same checksum file is not released again. A release that exists with another checksum file, or without one (an upload that did not finish), stops the run. The archives are made so that the same executable gives the same bytes. The comparison of the checksum files relies on the compression being stable (fixed mtime, gzip header and compression level), so when the compression implementation of the runner changes, a rerun may stop and ask a person to confirm.",
12747
+ "formulaVersion": "A formula that already names a higher version is not changed by an older GA, and a formula that already holds this version is not pushed again.",
12748
+ "tag": "<ComponentName>/v<version>, the same string as the unit tag in the source repository",
12749
+ "prerelease": "A prerelease is a GitHub prerelease and the formula is not changed.",
12750
+ "ga": {
12751
+ "formula": "Formula/<command>.rb",
12752
+ "push": "a fast-forward push to main, never forced",
12753
+ "commitIdentity": "The formula commit has github-actions[bot] <41898283+github-actions[bot]@users.noreply.github.com> as author and committer, not the author of the source repository, because the source repository may be private and the address would be written into the public history.",
12754
+ "layout": "Inside on_macos and on_linux, each on_arm and on_intel block holds a url and a sha256. A comment lists the supported platforms."
12755
+ },
12756
+ "token": {
12757
+ "source": "the GitHub App of the organization (blueprint-shared.templates.github-app)",
12758
+ "action": "actions/create-github-app-token",
12759
+ "repositories": "only the release repository",
12760
+ "permission": "permission-contents: write",
12761
+ "transport": "git gets the token as an HTTP header set in its environment (GIT_CONFIG_COUNT, GIT_CONFIG_KEY_n, GIT_CONFIG_VALUE_n) for the calls that need it, so the token is in no argument of git."
12762
+ },
12763
+ "runner": {
12764
+ "label": "the default label of selfHostedRunnerLabels",
12765
+ "setup": "actions/setup-go installs the Go version that go.mod names"
12766
+ },
12767
+ "unverified": "Homebrew documents a precompiled executable as a cask. A formula that installs a precompiled executable, with the url inside the on_* blocks, is the form goreleaser writes, and the Homebrew Cookbook does not describe it. The form is checked by brew install on macOS.",
12768
+ "orgValues": [
12769
+ "binaryReleaseRepository",
12770
+ "selfHostedRunnerLabels"
12771
+ ]
12772
+ }
12773
+ }
12774
+ }
12775
+ ],
12776
+ "source": {
12777
+ "kind": "published"
12778
+ },
12779
+ "content": {
12780
+ "value": {
12781
+ "usedWhen": "publish.to of the unit is binary (blueprint-shared.publishing.target-selection)",
12782
+ "build": "Cross-compiles for each platform of the unit in the policy with CGO_ENABLED=0 and -trimpath -buildvcs=false, so the same source builds the same bytes at a different commit (Go writes the commit and its time into the executable by default). Go only.",
12783
+ "archive": "<command>-<version>-<os>-<arch>.tar.gz",
12784
+ "checksum": {
12785
+ "file": "<command>-<version>.sha256",
12786
+ "format": "sha256sum"
12787
+ },
12788
+ "version": "The unit has a version.txt, and the script checks that it equals the version of the manifest before it publishes. After the build it runs the --version of the executable of the runner platform and checks that it prints the same version.",
12789
+ "repository": {
12790
+ "orgValue": "binaryReleaseRepository",
12791
+ "value": "The repository name only, without the owner. The owner is the owner of the source repository.",
12792
+ "visibility": "public",
12793
+ "optional": "The organization value is optional. Only a repository that has a binary unit fills it.",
12794
+ "empty": "Without a value the binary job stops at its first step and writes the reason, before the App token is made, so an empty repositories list never widens the token."
12795
+ },
12796
+ "rerun": "A release that exists with the same checksum file is not released again. A release that exists with another checksum file, or without one (an upload that did not finish), stops the run. The archives are made so that the same executable gives the same bytes. The comparison of the checksum files relies on the compression being stable (fixed mtime, gzip header and compression level), so when the compression implementation of the runner changes, a rerun may stop and ask a person to confirm.",
12797
+ "formulaVersion": "A formula that already names a higher version is not changed by an older GA, and a formula that already holds this version is not pushed again.",
12798
+ "tag": "<ComponentName>/v<version>, the same string as the unit tag in the source repository",
12799
+ "prerelease": "A prerelease is a GitHub prerelease and the formula is not changed.",
12800
+ "ga": {
12801
+ "formula": "Formula/<command>.rb",
12802
+ "push": "a fast-forward push to main, never forced",
12803
+ "commitIdentity": "The formula commit has github-actions[bot] <41898283+github-actions[bot]@users.noreply.github.com> as author and committer, not the author of the source repository, because the source repository may be private and the address would be written into the public history.",
12804
+ "layout": "Inside on_macos and on_linux, each on_arm and on_intel block holds a url and a sha256. A comment lists the supported platforms."
12805
+ },
12806
+ "token": {
12807
+ "source": "the GitHub App of the organization (blueprint-shared.templates.github-app)",
12808
+ "action": "actions/create-github-app-token",
12809
+ "repositories": "only the release repository",
12810
+ "permission": "permission-contents: write",
12811
+ "transport": "git gets the token as an HTTP header set in its environment (GIT_CONFIG_COUNT, GIT_CONFIG_KEY_n, GIT_CONFIG_VALUE_n) for the calls that need it, so the token is in no argument of git."
12812
+ },
12813
+ "runner": {
12814
+ "label": "the default label of selfHostedRunnerLabels",
12815
+ "setup": "actions/setup-go installs the Go version that go.mod names"
12816
+ },
12817
+ "unverified": "Homebrew documents a precompiled executable as a cask. A formula that installs a precompiled executable, with the url inside the on_* blocks, is the form goreleaser writes, and the Homebrew Cookbook does not describe it. The form is checked by brew install on macOS.",
12818
+ "orgValues": [
12819
+ "binaryReleaseRepository",
12820
+ "selfHostedRunnerLabels"
12821
+ ]
12822
+ }
12823
+ }
12824
+ },
12825
+ {
12826
+ "id": "blueprint-shared.publishing.container-image",
12827
+ "tool": "blueprint-shared",
12828
+ "topics": [
12829
+ "publishing"
12830
+ ],
12831
+ "title": "容器映像推 ghcr",
12832
+ "description": "`publish.to` 是 `image` 的單元,用單元目錄的 Dockerfile 依政策檔平台建置,推到 `ghcr.io/<owner>/<ComponentName>:<version>`,不打 latest,digest 附在來源倉單元 tag 的 Release。用 job 的 `GITHUB_TOKEN` 加 `contents: write` 與 `packages: write`,套件第一次推送是私有。",
12833
+ "variants": [
12834
+ {
12835
+ "since": "0.11.0",
12836
+ "content": {
12837
+ "value": {
12838
+ "usedWhen": "publish.to of the unit is image (blueprint-shared.publishing.target-selection)",
12839
+ "build": "Builds with the Dockerfile in the directory of the unit, for each platform of the unit in the policy.",
12840
+ "image": "ghcr.io/<owner>/<ComponentName>:<version>, and no latest tag",
12841
+ "stages": "The unit publishes the stages of its own stages in release-policy.json. A prerelease version is pushed too, and the tag is the full version, for example 1.2.0-rc.1. Every version gets one tag.",
12842
+ "digest": {
12843
+ "file": "<ComponentName>-<version>.digest",
12844
+ "attachedTo": "the Release of the unit tag in the source repository",
12845
+ "also": "printed in the job summary"
12846
+ },
12847
+ "configuration": "The image carries no configuration of the organization. The configuration is mounted at deployment.",
12848
+ "token": {
12849
+ "source": "GITHUB_TOKEN of the job",
12850
+ "permission": "contents: write and packages: write",
12851
+ "why": "The GitHub App of the organization has no packages permission. The digest is attached to a Release of the source repository itself, so the same GITHUB_TOKEN is enough (contents: write), and no other credential is made.",
12852
+ "dockerConfig": "DOCKER_CONFIG is in the temporary directory of the job and is deleted when the job ends. Its config.json lists the cli-plugins directory of the original DOCKER_CONFIG (cliPluginsExtraDirs), so the buildx plugin of the runner is still found."
12853
+ },
12854
+ "crossBuild": "The build stage compiles for the target platform on the build platform (FROM --platform=$BUILDPLATFORM), and does not run under emulation.",
12855
+ "runner": {
12856
+ "label": "the docker label of selfHostedRunnerLabels, brought into the template as a placeholder",
12857
+ "prerequisite": "The runner has docker with a daemon that answers, a docker CLI that reads cliPluginsExtraDirs from config.json, the buildx plugin, jq, and access to the registry that serves the buildkit image the docker-container driver pulls. image-units.sh runs docker buildx version first, and stops with a message that the runner needs buildx when it is missing.",
12858
+ "builder": "Before the build the script creates a builder (docker buildx create --name publish-<pid> --driver docker-container --use), because the default builder cannot build several platforms in one command. When the script ends, whatever the exit status, it removes the builder (docker buildx rm; a failure there does not change the exit status) and then deletes DOCKER_CONFIG.",
12859
+ "missing": "When the organization gives no docker label, the compose step writes the default label, and image-units.sh stops and writes the reason (it names selfHostedRunnerLabels.docker) when the runner has no docker or the docker daemon does not answer."
12860
+ },
12861
+ "alreadyPublished": "An image that already exists is skipped and its digest is recorded. A digest attached to the Release that differs from the digest of the existing image stops the run.",
12862
+ "inspect": "Only an answer that says the image is not there (the message has not found, MANIFEST_UNKNOWN, NAME_UNKNOWN or name unknown, in any case; a package that was never pushed answers NAME_UNKNOWN) counts as an image that does not exist. Any other error of docker buildx imagetools inspect, such as a network or authentication error, stops the run and is printed, and nothing is pushed.",
12863
+ "firstPush": "A package starts as private on its first push. To make it public a person changes it once in GitHub, and the change cannot be undone.",
12864
+ "orgValues": [
12865
+ "selfHostedRunnerLabels"
12866
+ ]
12867
+ }
12868
+ }
12869
+ }
12870
+ ],
12871
+ "source": {
12872
+ "kind": "published"
12873
+ },
12874
+ "content": {
12875
+ "value": {
12876
+ "usedWhen": "publish.to of the unit is image (blueprint-shared.publishing.target-selection)",
12877
+ "build": "Builds with the Dockerfile in the directory of the unit, for each platform of the unit in the policy.",
12878
+ "image": "ghcr.io/<owner>/<ComponentName>:<version>, and no latest tag",
12879
+ "stages": "The unit publishes the stages of its own stages in release-policy.json. A prerelease version is pushed too, and the tag is the full version, for example 1.2.0-rc.1. Every version gets one tag.",
12880
+ "digest": {
12881
+ "file": "<ComponentName>-<version>.digest",
12882
+ "attachedTo": "the Release of the unit tag in the source repository",
12883
+ "also": "printed in the job summary"
12884
+ },
12885
+ "configuration": "The image carries no configuration of the organization. The configuration is mounted at deployment.",
12886
+ "token": {
12887
+ "source": "GITHUB_TOKEN of the job",
12888
+ "permission": "contents: write and packages: write",
12889
+ "why": "The GitHub App of the organization has no packages permission. The digest is attached to a Release of the source repository itself, so the same GITHUB_TOKEN is enough (contents: write), and no other credential is made.",
12890
+ "dockerConfig": "DOCKER_CONFIG is in the temporary directory of the job and is deleted when the job ends. Its config.json lists the cli-plugins directory of the original DOCKER_CONFIG (cliPluginsExtraDirs), so the buildx plugin of the runner is still found."
12891
+ },
12892
+ "crossBuild": "The build stage compiles for the target platform on the build platform (FROM --platform=$BUILDPLATFORM), and does not run under emulation.",
12893
+ "runner": {
12894
+ "label": "the docker label of selfHostedRunnerLabels, brought into the template as a placeholder",
12895
+ "prerequisite": "The runner has docker with a daemon that answers, a docker CLI that reads cliPluginsExtraDirs from config.json, the buildx plugin, jq, and access to the registry that serves the buildkit image the docker-container driver pulls. image-units.sh runs docker buildx version first, and stops with a message that the runner needs buildx when it is missing.",
12896
+ "builder": "Before the build the script creates a builder (docker buildx create --name publish-<pid> --driver docker-container --use), because the default builder cannot build several platforms in one command. When the script ends, whatever the exit status, it removes the builder (docker buildx rm; a failure there does not change the exit status) and then deletes DOCKER_CONFIG.",
12897
+ "missing": "When the organization gives no docker label, the compose step writes the default label, and image-units.sh stops and writes the reason (it names selfHostedRunnerLabels.docker) when the runner has no docker or the docker daemon does not answer."
12898
+ },
12899
+ "alreadyPublished": "An image that already exists is skipped and its digest is recorded. A digest attached to the Release that differs from the digest of the existing image stops the run.",
12900
+ "inspect": "Only an answer that says the image is not there (the message has not found, MANIFEST_UNKNOWN, NAME_UNKNOWN or name unknown, in any case; a package that was never pushed answers NAME_UNKNOWN) counts as an image that does not exist. Any other error of docker buildx imagetools inspect, such as a network or authentication error, stops the run and is printed, and nothing is pushed.",
12901
+ "firstPush": "A package starts as private on its first push. To make it public a person changes it once in GitHub, and the change cannot be undone.",
12902
+ "orgValues": [
12903
+ "selfHostedRunnerLabels"
12904
+ ]
12905
+ }
12906
+ }
12907
+ },
12908
+ {
12909
+ "id": "blueprint-shared.release-policy.stage-selection-rule",
12910
+ "tool": "blueprint-shared",
12911
+ "topics": [
12912
+ "release-policy"
12913
+ ],
12914
+ "title": "發布階段的選擇規則",
12915
+ "variants": [
12916
+ {
12917
+ "since": "0.1.0",
12918
+ "content": {
12919
+ "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元。預發布環境是 production 以外的部署環境,寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
12920
+ }
12921
+ },
12922
+ {
12923
+ "since": "0.4.0",
12924
+ "content": {
12925
+ "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元。預發布環境是 `prod` 以外的部署環境(環境名見 `blueprint-shared.environments.names`),寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
12926
+ }
12927
+ },
12928
+ {
12929
+ "since": "0.11.0",
12930
+ "content": {
12931
+ "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元,但 `publish.to` 是 `image` 的單元除外,因為它發布容器映像,不經 tag 部署,也不必寫 `targets`(`blueprint-shared.release-policy.unit-publish`)。預發布環境是 `prod` 以外的部署環境(環境名見 `blueprint-shared.environments.names`),寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
12932
+ }
12933
+ }
12934
+ ],
12935
+ "source": {
12936
+ "kind": "published"
12937
+ },
12938
+ "content": {
12939
+ "statement": "有持久化資料的單元,至少走一個預發布階段。倉庫有預發布環境時,部署型單元也至少走一個預發布階段。部署型單元是 `kind` 為 `service`、`backend`、`web` 的單元,但 `publish.to` 是 `image` 的單元除外,因為它發布容器映像,不經 tag 部署,也不必寫 `targets`(`blueprint-shared.release-policy.unit-publish`)。預發布環境是 `prod` 以外的部署環境(環境名見 `blueprint-shared.environments.names`),寫進政策檔就是單元或倉庫共用的 `targets` 有 alpha、beta 或 rc 的去處。`scripts/ci/check-release-policy.sh` 會擋下這種政策檔裡只發 GA 的部署型單元。"
11830
12940
  }
11831
12941
  },
11832
12942
  {
@@ -12178,6 +13288,28 @@
12178
13288
  "description": "倉庫共用的階段去處,鍵是階段,值是環境名(`blueprint-shared.environments.names`),例如 `{ \"alpha\": \"dev\", \"beta\": \"stg\", \"rc\": \"stg\", \"ga\": \"prod\" }`,這時部署 rc 會蓋掉 stg 上的 beta。service、backend、web 單元每個階段要從這裡或單元自己的 `targets` 找得到去處,所以由產品 tag 觸發的 ga 也要寫。"
12179
13289
  }
12180
13290
  }
13291
+ },
13292
+ {
13293
+ "since": "0.11.0",
13294
+ "content": {
13295
+ "schema": {
13296
+ "type": "object",
13297
+ "minProperties": 1,
13298
+ "propertyNames": {
13299
+ "enum": [
13300
+ "alpha",
13301
+ "beta",
13302
+ "rc",
13303
+ "ga"
13304
+ ]
13305
+ },
13306
+ "additionalProperties": {
13307
+ "type": "string",
13308
+ "minLength": 1
13309
+ },
13310
+ "description": "倉庫共用的階段去處,鍵是階段,值是環境名(`blueprint-shared.environments.names`),例如 `{ \"alpha\": \"dev\", \"beta\": \"stg\", \"rc\": \"stg\", \"ga\": \"prod\" }`,這時部署 rc 會蓋掉 stg 上的 beta。service、backend、web 單元每個階段要從這裡或單元自己的 `targets` 找得到去處,所以由產品 tag 觸發的 ga 也要寫。`publish.to` 是 `image` 的單元不經 tag 部署,不受這條限制。"
13311
+ }
13312
+ }
12181
13313
  }
12182
13314
  ],
12183
13315
  "source": {
@@ -12199,7 +13331,7 @@
12199
13331
  "type": "string",
12200
13332
  "minLength": 1
12201
13333
  },
12202
- "description": "倉庫共用的階段去處,鍵是階段,值是環境名(`blueprint-shared.environments.names`),例如 `{ \"alpha\": \"dev\", \"beta\": \"stg\", \"rc\": \"stg\", \"ga\": \"prod\" }`,這時部署 rc 會蓋掉 stg 上的 beta。service、backend、web 單元每個階段要從這裡或單元自己的 `targets` 找得到去處,所以由產品 tag 觸發的 ga 也要寫。"
13334
+ "description": "倉庫共用的階段去處,鍵是階段,值是環境名(`blueprint-shared.environments.names`),例如 `{ \"alpha\": \"dev\", \"beta\": \"stg\", \"rc\": \"stg\", \"ga\": \"prod\" }`,這時部署 rc 會蓋掉 stg 上的 beta。service、backend、web 單元每個階段要從這裡或單元自己的 `targets` 找得到去處,所以由產品 tag 觸發的 ga 也要寫。`publish.to` 是 `image` 的單元不經 tag 部署,不受這條限制。"
12203
13335
  }
12204
13336
  }
12205
13337
  },
@@ -12450,6 +13582,28 @@
12450
13582
  "description": "這個單元的階段去處,蓋過倉庫共用的 `targets`。mobile 與 desktop 單元寫商店通道。行動端的 `ga` 通道(例如 `app-store`)是送商店審核,範本只做模擬。package 與 sdk 單元不寫。"
12451
13583
  }
12452
13584
  }
13585
+ },
13586
+ {
13587
+ "since": "0.11.0",
13588
+ "content": {
13589
+ "schema": {
13590
+ "type": "object",
13591
+ "minProperties": 1,
13592
+ "propertyNames": {
13593
+ "enum": [
13594
+ "alpha",
13595
+ "beta",
13596
+ "rc",
13597
+ "ga"
13598
+ ]
13599
+ },
13600
+ "additionalProperties": {
13601
+ "type": "string",
13602
+ "minLength": 1
13603
+ },
13604
+ "description": "這個單元的階段去處,蓋過倉庫共用的 `targets`。mobile 與 desktop 單元寫商店通道。行動端的 `ga` 通道(例如 `app-store`)是送商店審核,範本只做模擬。package 與 sdk 單元不寫。`publish.to` 是 `image` 的單元不經 tag 部署,不必寫。"
13605
+ }
13606
+ }
12453
13607
  }
12454
13608
  ],
12455
13609
  "source": {
@@ -12471,29 +13625,92 @@
12471
13625
  "type": "string",
12472
13626
  "minLength": 1
12473
13627
  },
12474
- "description": "這個單元的階段去處,蓋過倉庫共用的 `targets`。mobile 與 desktop 單元寫商店通道。行動端的 `ga` 通道(例如 `app-store`)是送商店審核,範本只做模擬。package 與 sdk 單元不寫。"
13628
+ "description": "這個單元的階段去處,蓋過倉庫共用的 `targets`。mobile 與 desktop 單元寫商店通道。行動端的 `ga` 通道(例如 `app-store`)是送商店審核,範本只做模擬。package 與 sdk 單元不寫。`publish.to` 是 `image` 的單元不經 tag 部署,不必寫。"
12475
13629
  }
12476
13630
  }
12477
13631
  },
12478
13632
  {
12479
- "id": "blueprint-shared.release-policy.unit-depends-on",
13633
+ "id": "blueprint-shared.release-policy.unit-publish",
12480
13634
  "tool": "blueprint-shared",
12481
13635
  "topics": [
12482
13636
  "release-policy"
12483
13637
  ],
12484
- "title": "政策檔 units.*.dependsOn 欄位",
13638
+ "title": "政策檔 units.*.publish 欄位",
12485
13639
  "variants": [
12486
13640
  {
12487
- "since": "0.1.0",
13641
+ "since": "0.11.0",
12488
13642
  "content": {
12489
13643
  "schema": {
12490
- "type": "array",
12491
- "uniqueItems": true,
12492
- "items": {
12493
- "type": "string",
12494
- "pattern": "^[a-z0-9][a-z0-9._-]*$"
13644
+ "type": "object",
13645
+ "required": [
13646
+ "to"
13647
+ ],
13648
+ "additionalProperties": false,
13649
+ "properties": {
13650
+ "to": {
13651
+ "enum": [
13652
+ "binary",
13653
+ "image",
13654
+ "none"
13655
+ ]
13656
+ },
13657
+ "command": {
13658
+ "type": "string",
13659
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
13660
+ },
13661
+ "description": {
13662
+ "type": "string",
13663
+ "minLength": 1
13664
+ },
13665
+ "platforms": {
13666
+ "type": "array",
13667
+ "minItems": 1,
13668
+ "uniqueItems": true,
13669
+ "items": {
13670
+ "type": "string",
13671
+ "pattern": "^[a-z0-9]+/[a-z0-9]+$"
13672
+ }
13673
+ }
12495
13674
  },
12496
- "description": "套件清單表達不了的同倉依賴,例如跨語言的綁定。值是政策檔裡的單元。"
13675
+ "allOf": [
13676
+ {
13677
+ "if": {
13678
+ "required": [
13679
+ "to"
13680
+ ],
13681
+ "properties": {
13682
+ "to": {
13683
+ "const": "binary"
13684
+ }
13685
+ }
13686
+ },
13687
+ "then": {
13688
+ "required": [
13689
+ "command",
13690
+ "description",
13691
+ "platforms"
13692
+ ]
13693
+ }
13694
+ },
13695
+ {
13696
+ "if": {
13697
+ "required": [
13698
+ "to"
13699
+ ],
13700
+ "properties": {
13701
+ "to": {
13702
+ "const": "image"
13703
+ }
13704
+ }
13705
+ },
13706
+ "then": {
13707
+ "required": [
13708
+ "platforms"
13709
+ ]
13710
+ }
13711
+ }
13712
+ ],
13713
+ "description": "選填。這個單元發布到哪裡,`to` 是 `binary`(編譯好的執行檔)、`image`(容器映像推 ghcr)或 `none`(不發布)。沒寫時照單元的檔案判斷。`binary` 只用於 kind 是 `package` 的單元,要帶 `command`、`description`、`platforms`,這一版只支援 Go,單元要有 `go.mod`。`image` 只用於 kind 是 `service` 或 `backend` 的單元,要帶 `platforms`,不必寫 `targets`。選目標的規則見 `blueprint-shared.publishing.target-selection`。"
12497
13714
  }
12498
13715
  }
12499
13716
  }
@@ -12503,49 +13720,470 @@
12503
13720
  },
12504
13721
  "content": {
12505
13722
  "schema": {
12506
- "type": "array",
12507
- "uniqueItems": true,
12508
- "items": {
12509
- "type": "string",
12510
- "pattern": "^[a-z0-9][a-z0-9._-]*$"
13723
+ "type": "object",
13724
+ "required": [
13725
+ "to"
13726
+ ],
13727
+ "additionalProperties": false,
13728
+ "properties": {
13729
+ "to": {
13730
+ "enum": [
13731
+ "binary",
13732
+ "image",
13733
+ "none"
13734
+ ]
13735
+ },
13736
+ "command": {
13737
+ "type": "string",
13738
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
13739
+ },
13740
+ "description": {
13741
+ "type": "string",
13742
+ "minLength": 1
13743
+ },
13744
+ "platforms": {
13745
+ "type": "array",
13746
+ "minItems": 1,
13747
+ "uniqueItems": true,
13748
+ "items": {
13749
+ "type": "string",
13750
+ "pattern": "^[a-z0-9]+/[a-z0-9]+$"
13751
+ }
13752
+ }
12511
13753
  },
12512
- "description": "套件清單表達不了的同倉依賴,例如跨語言的綁定。值是政策檔裡的單元。"
12513
- }
12514
- }
12515
- },
12516
- {
12517
- "id": "blueprint-shared.release-policy.file",
12518
- "tool": "blueprint-shared",
12519
- "topics": [
12520
- "release-policy"
12521
- ],
12522
- "title": "發布政策檔的位置與核對",
12523
- "variants": [
12524
- {
12525
- "since": "0.1.0",
12526
- "content": {
12527
- "statement": "政策檔是倉庫根目錄的 `release-policy.json`,格式照 `blueprint-shared.release-policy.schema`(draft-07)。它記每個 release-please 單元的 `kind`、`stages`、`targets`、`dependsOn` 與倉庫屬於哪個產品,不記版號。`scripts/ci/check-release-policy-schema.sh` 核對 schema,`scripts/ci/check-release-policy.sh` 核對單元和 `release-please-config.json` 一致。"
13754
+ "allOf": [
13755
+ {
13756
+ "if": {
13757
+ "required": [
13758
+ "to"
13759
+ ],
13760
+ "properties": {
13761
+ "to": {
13762
+ "const": "binary"
13763
+ }
13764
+ }
13765
+ },
13766
+ "then": {
13767
+ "required": [
13768
+ "command",
13769
+ "description",
13770
+ "platforms"
13771
+ ]
13772
+ }
13773
+ },
13774
+ {
13775
+ "if": {
13776
+ "required": [
13777
+ "to"
13778
+ ],
13779
+ "properties": {
13780
+ "to": {
13781
+ "const": "image"
13782
+ }
13783
+ }
13784
+ },
13785
+ "then": {
13786
+ "required": [
13787
+ "platforms"
13788
+ ]
13789
+ }
13790
+ }
13791
+ ],
13792
+ "description": "選填。這個單元發布到哪裡,`to` 是 `binary`(編譯好的執行檔)、`image`(容器映像推 ghcr)或 `none`(不發布)。沒寫時照單元的檔案判斷。`binary` 只用於 kind 是 `package` 的單元,要帶 `command`、`description`、`platforms`,這一版只支援 Go,單元要有 `go.mod`。`image` 只用於 kind 是 `service` 或 `backend` 的單元,要帶 `platforms`,不必寫 `targets`。選目標的規則見 `blueprint-shared.publishing.target-selection`。"
13793
+ }
13794
+ }
13795
+ },
13796
+ {
13797
+ "id": "blueprint-shared.release-policy.unit-depends-on",
13798
+ "tool": "blueprint-shared",
13799
+ "topics": [
13800
+ "release-policy"
13801
+ ],
13802
+ "title": "政策檔 units.*.dependsOn 欄位",
13803
+ "variants": [
13804
+ {
13805
+ "since": "0.1.0",
13806
+ "content": {
13807
+ "schema": {
13808
+ "type": "array",
13809
+ "uniqueItems": true,
13810
+ "items": {
13811
+ "type": "string",
13812
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
13813
+ },
13814
+ "description": "套件清單表達不了的同倉依賴,例如跨語言的綁定。值是政策檔裡的單元。"
13815
+ }
13816
+ }
13817
+ }
13818
+ ],
13819
+ "source": {
13820
+ "kind": "published"
13821
+ },
13822
+ "content": {
13823
+ "schema": {
13824
+ "type": "array",
13825
+ "uniqueItems": true,
13826
+ "items": {
13827
+ "type": "string",
13828
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
13829
+ },
13830
+ "description": "套件清單表達不了的同倉依賴,例如跨語言的綁定。值是政策檔裡的單元。"
13831
+ }
13832
+ }
13833
+ },
13834
+ {
13835
+ "id": "blueprint-shared.release-policy.file",
13836
+ "tool": "blueprint-shared",
13837
+ "topics": [
13838
+ "release-policy"
13839
+ ],
13840
+ "title": "發布政策檔的位置與核對",
13841
+ "variants": [
13842
+ {
13843
+ "since": "0.1.0",
13844
+ "content": {
13845
+ "statement": "政策檔是倉庫根目錄的 `release-policy.json`,格式照 `blueprint-shared.release-policy.schema`(draft-07)。它記每個 release-please 單元的 `kind`、`stages`、`targets`、`dependsOn` 與倉庫屬於哪個產品,不記版號。`scripts/ci/check-release-policy-schema.sh` 核對 schema,`scripts/ci/check-release-policy.sh` 核對單元和 `release-please-config.json` 一致。"
13846
+ }
13847
+ },
13848
+ {
13849
+ "since": "0.11.0",
13850
+ "content": {
13851
+ "statement": "政策檔是倉庫根目錄的 `release-policy.json`,格式照 `blueprint-shared.release-policy.schema`(draft-07)。它記每個 release-please 單元的 `kind`、`stages`、`targets`、`dependsOn`、選填的 `publish`(發布目標,見 `blueprint-shared.release-policy.unit-publish`)與倉庫屬於哪個產品,不記版號。`scripts/ci/check-release-policy-schema.sh` 核對 schema,`scripts/ci/check-release-policy.sh` 核對單元和 `release-please-config.json` 一致,並核對 `publish` 的跨欄位條件。部署型單元要有 `targets`,`publish.to` 是 `image` 的單元除外。"
13852
+ }
13853
+ }
13854
+ ],
13855
+ "source": {
13856
+ "kind": "published"
13857
+ },
13858
+ "content": {
13859
+ "statement": "政策檔是倉庫根目錄的 `release-policy.json`,格式照 `blueprint-shared.release-policy.schema`(draft-07)。它記每個 release-please 單元的 `kind`、`stages`、`targets`、`dependsOn`、選填的 `publish`(發布目標,見 `blueprint-shared.release-policy.unit-publish`)與倉庫屬於哪個產品,不記版號。`scripts/ci/check-release-policy-schema.sh` 核對 schema,`scripts/ci/check-release-policy.sh` 核對單元和 `release-please-config.json` 一致,並核對 `publish` 的跨欄位條件。部署型單元要有 `targets`,`publish.to` 是 `image` 的單元除外。"
13860
+ }
13861
+ },
13862
+ {
13863
+ "id": "blueprint-shared.release-policy.schema",
13864
+ "tool": "blueprint-shared",
13865
+ "topics": [
13866
+ "release-policy"
13867
+ ],
13868
+ "title": "政策檔的 JSON Schema",
13869
+ "description": "整份政策檔的 draft-07 schema,內容和 blueprint-shared-templates 的 `release/schemas/release-policy.schema.json` 相同。上面逐欄的 fact 是同一份欄位的說明。",
13870
+ "variants": [
13871
+ {
13872
+ "since": "0.1.0",
13873
+ "content": {
13874
+ "schema": {
13875
+ "$schema": "http://json-schema.org/draft-07/schema#",
13876
+ "$id": "https://cdn.jsdelivr.net/npm/blueprint-shared-templates/release/schemas/release-policy.schema.json",
13877
+ "title": "release-policy.json",
13878
+ "description": "Fixed release cadence of every release-please unit in a repository, where each stage ships to, and which product the repository belongs to. Explained in docs/release-policy.md.",
13879
+ "type": "object",
13880
+ "required": [
13881
+ "product",
13882
+ "access"
13883
+ ],
13884
+ "additionalProperties": false,
13885
+ "allOf": [
13886
+ {
13887
+ "description": "A member repository (product.primary) lists its units.",
13888
+ "if": {
13889
+ "properties": {
13890
+ "product": {
13891
+ "type": "object",
13892
+ "required": [
13893
+ "primary"
13894
+ ]
13895
+ }
13896
+ }
13897
+ },
13898
+ "then": {
13899
+ "required": [
13900
+ "units"
13901
+ ]
13902
+ }
13903
+ },
13904
+ {
13905
+ "description": "A restricted repository names the npm scope its packages publish under.",
13906
+ "if": {
13907
+ "properties": {
13908
+ "access": {
13909
+ "const": "restricted"
13910
+ }
13911
+ },
13912
+ "required": [
13913
+ "access"
13914
+ ]
13915
+ },
13916
+ "then": {
13917
+ "required": [
13918
+ "scope"
13919
+ ]
13920
+ }
13921
+ },
13922
+ {
13923
+ "description": "So does one with any restricted unit. A hub has no units, so only its own access can ask for a scope.",
13924
+ "if": {
13925
+ "required": [
13926
+ "units"
13927
+ ],
13928
+ "properties": {
13929
+ "units": {
13930
+ "type": "object",
13931
+ "not": {
13932
+ "additionalProperties": {
13933
+ "not": {
13934
+ "type": "object",
13935
+ "required": [
13936
+ "access"
13937
+ ],
13938
+ "properties": {
13939
+ "access": {
13940
+ "const": "restricted"
13941
+ }
13942
+ }
13943
+ }
13944
+ }
13945
+ }
13946
+ }
13947
+ }
13948
+ },
13949
+ "then": {
13950
+ "required": [
13951
+ "scope"
13952
+ ]
13953
+ }
13954
+ }
13955
+ ],
13956
+ "properties": {
13957
+ "$schema": {
13958
+ "type": "string"
13959
+ },
13960
+ "product": {
13961
+ "description": "The product whose version sequence this repository shares. The primary repository holds the Release Plans under releases/ and lists the members: the product repository itself for a single-repository product, <product>-hub for one spread over several repositories. A member repository names the primary.",
13962
+ "oneOf": [
13963
+ {
13964
+ "title": "primary",
13965
+ "type": "object",
13966
+ "required": [
13967
+ "name",
13968
+ "members"
13969
+ ],
13970
+ "additionalProperties": false,
13971
+ "properties": {
13972
+ "name": {
13973
+ "$ref": "#/definitions/productName"
13974
+ },
13975
+ "members": {
13976
+ "description": "Member repositories as owner/repo. Empty when the product lives in this repository alone.",
13977
+ "type": "array",
13978
+ "uniqueItems": true,
13979
+ "items": {
13980
+ "$ref": "#/definitions/repo"
13981
+ }
13982
+ }
13983
+ }
13984
+ },
13985
+ {
13986
+ "title": "member",
13987
+ "type": "object",
13988
+ "required": [
13989
+ "name",
13990
+ "primary"
13991
+ ],
13992
+ "additionalProperties": false,
13993
+ "properties": {
13994
+ "name": {
13995
+ "$ref": "#/definitions/productName"
13996
+ },
13997
+ "primary": {
13998
+ "$ref": "#/definitions/repo"
13999
+ }
14000
+ }
14001
+ }
14002
+ ]
14003
+ },
14004
+ "access": {
14005
+ "description": "Whether what this repository publishes is a non-public package once published: public, or restricted. It says nothing about whether the repository is public, where it publishes, or private: true. A unit's own access overrides it. A hub writes it too.",
14006
+ "$ref": "#/definitions/access"
14007
+ },
14008
+ "scope": {
14009
+ "description": "npm scope of the restricted packages, e.g. \"@my-org\". Required when this repository or any unit is restricted.",
14010
+ "type": "string",
14011
+ "pattern": "^@[a-z0-9][a-z0-9._-]*$"
14012
+ },
14013
+ "targets": {
14014
+ "description": "Destination of each stage shared by the service, backend and web units of this repository, e.g. an environment name.",
14015
+ "$ref": "#/definitions/targets"
14016
+ },
14017
+ "units": {
14018
+ "description": "Every unit of release-please-config.json, keyed by its component. A unit missing here, or listed here but not there, fails the daily consistency check. Required in a member repository; a <product>-hub has no units and leaves it out.",
14019
+ "type": "object",
14020
+ "minProperties": 1,
14021
+ "propertyNames": {
14022
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
14023
+ },
14024
+ "additionalProperties": {
14025
+ "$ref": "#/definitions/unit"
14026
+ }
14027
+ }
14028
+ },
14029
+ "definitions": {
14030
+ "productName": {
14031
+ "type": "string",
14032
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
14033
+ },
14034
+ "repo": {
14035
+ "type": "string",
14036
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
14037
+ },
14038
+ "access": {
14039
+ "enum": [
14040
+ "public",
14041
+ "restricted"
14042
+ ]
14043
+ },
14044
+ "stage": {
14045
+ "enum": [
14046
+ "alpha",
14047
+ "beta",
14048
+ "rc",
14049
+ "ga"
14050
+ ]
14051
+ },
14052
+ "targets": {
14053
+ "type": "object",
14054
+ "minProperties": 1,
14055
+ "propertyNames": {
14056
+ "$ref": "#/definitions/stage"
14057
+ },
14058
+ "additionalProperties": {
14059
+ "type": "string",
14060
+ "minLength": 1
14061
+ }
14062
+ },
14063
+ "unit": {
14064
+ "type": "object",
14065
+ "required": [
14066
+ "kind",
14067
+ "stages"
14068
+ ],
14069
+ "additionalProperties": false,
14070
+ "properties": {
14071
+ "kind": {
14072
+ "description": "Release type of the unit. package and sdk publish every stage to their registry; mobile and desktop ship to store channels; service, backend and web deploy to environments.",
14073
+ "enum": [
14074
+ "package",
14075
+ "sdk",
14076
+ "service",
14077
+ "backend",
14078
+ "web",
14079
+ "mobile",
14080
+ "desktop"
14081
+ ]
14082
+ },
14083
+ "access": {
14084
+ "description": "Overrides the repository access for this unit. A unit that does not publish fills in what it would be if it did.",
14085
+ "$ref": "#/definitions/access"
14086
+ },
14087
+ "stages": {
14088
+ "description": "Stages the unit walks when it releases on its own, in order and ending at ga. A unit depended on by a unit in a prerelease, and changed in this release, follows that unit's stages instead.",
14089
+ "enum": [
14090
+ [
14091
+ "ga"
14092
+ ],
14093
+ [
14094
+ "rc",
14095
+ "ga"
14096
+ ],
14097
+ [
14098
+ "beta",
14099
+ "ga"
14100
+ ],
14101
+ [
14102
+ "beta",
14103
+ "rc",
14104
+ "ga"
14105
+ ],
14106
+ [
14107
+ "alpha",
14108
+ "ga"
14109
+ ],
14110
+ [
14111
+ "alpha",
14112
+ "rc",
14113
+ "ga"
14114
+ ],
14115
+ [
14116
+ "alpha",
14117
+ "beta",
14118
+ "ga"
14119
+ ],
14120
+ [
14121
+ "alpha",
14122
+ "beta",
14123
+ "rc",
14124
+ "ga"
14125
+ ]
14126
+ ]
14127
+ },
14128
+ "targets": {
14129
+ "description": "Destination of each stage for this unit, overriding the repository targets. Store channels for mobile and desktop.",
14130
+ "$ref": "#/definitions/targets"
14131
+ },
14132
+ "dependsOn": {
14133
+ "description": "Same-repository units this unit depends on that its package manifest cannot express, e.g. a binding across languages.",
14134
+ "type": "array",
14135
+ "uniqueItems": true,
14136
+ "items": {
14137
+ "type": "string",
14138
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
14139
+ }
14140
+ }
14141
+ },
14142
+ "allOf": [
14143
+ {
14144
+ "if": {
14145
+ "properties": {
14146
+ "kind": {
14147
+ "enum": [
14148
+ "mobile",
14149
+ "desktop"
14150
+ ]
14151
+ }
14152
+ }
14153
+ },
14154
+ "then": {
14155
+ "required": [
14156
+ "targets"
14157
+ ]
14158
+ }
14159
+ },
14160
+ {
14161
+ "if": {
14162
+ "properties": {
14163
+ "kind": {
14164
+ "enum": [
14165
+ "package",
14166
+ "sdk"
14167
+ ]
14168
+ }
14169
+ }
14170
+ },
14171
+ "then": {
14172
+ "not": {
14173
+ "required": [
14174
+ "targets"
14175
+ ]
14176
+ }
14177
+ }
14178
+ }
14179
+ ]
14180
+ }
14181
+ }
14182
+ }
12528
14183
  }
12529
- }
12530
- ],
12531
- "source": {
12532
- "kind": "published"
12533
- },
12534
- "content": {
12535
- "statement": "政策檔是倉庫根目錄的 `release-policy.json`,格式照 `blueprint-shared.release-policy.schema`(draft-07)。它記每個 release-please 單元的 `kind`、`stages`、`targets`、`dependsOn` 與倉庫屬於哪個產品,不記版號。`scripts/ci/check-release-policy-schema.sh` 核對 schema,`scripts/ci/check-release-policy.sh` 核對單元和 `release-please-config.json` 一致。"
12536
- }
12537
- },
12538
- {
12539
- "id": "blueprint-shared.release-policy.schema",
12540
- "tool": "blueprint-shared",
12541
- "topics": [
12542
- "release-policy"
12543
- ],
12544
- "title": "政策檔的 JSON Schema",
12545
- "description": "整份政策檔的 draft-07 schema,內容和 blueprint-shared-templates 的 `release/schemas/release-policy.schema.json` 相同。上面逐欄的 fact 是同一份欄位的說明。",
12546
- "variants": [
14184
+ },
12547
14185
  {
12548
- "since": "0.1.0",
14186
+ "since": "0.4.0",
12549
14187
  "content": {
12550
14188
  "schema": {
12551
14189
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -12554,11 +14192,35 @@
12554
14192
  "description": "Fixed release cadence of every release-please unit in a repository, where each stage ships to, and which product the repository belongs to. Explained in docs/release-policy.md.",
12555
14193
  "type": "object",
12556
14194
  "required": [
12557
- "product",
12558
14195
  "access"
12559
14196
  ],
12560
14197
  "additionalProperties": false,
12561
14198
  "allOf": [
14199
+ {
14200
+ "description": "A repository of the organization layer belongs to no product and leaves product out. Every other repository names its product.",
14201
+ "if": {
14202
+ "properties": {
14203
+ "layer": {
14204
+ "const": "organization"
14205
+ }
14206
+ },
14207
+ "required": [
14208
+ "layer"
14209
+ ]
14210
+ },
14211
+ "then": {
14212
+ "not": {
14213
+ "required": [
14214
+ "product"
14215
+ ]
14216
+ }
14217
+ },
14218
+ "else": {
14219
+ "required": [
14220
+ "product"
14221
+ ]
14222
+ }
14223
+ },
12562
14224
  {
12563
14225
  "description": "A member repository (product.primary) lists its units.",
12564
14226
  "if": {
@@ -12569,7 +14231,10 @@
12569
14231
  "primary"
12570
14232
  ]
12571
14233
  }
12572
- }
14234
+ },
14235
+ "required": [
14236
+ "product"
14237
+ ]
12573
14238
  },
12574
14239
  "then": {
12575
14240
  "required": [
@@ -12634,7 +14299,7 @@
12634
14299
  "type": "string"
12635
14300
  },
12636
14301
  "product": {
12637
- "description": "The product whose version sequence this repository shares. The primary repository holds the Release Plans under releases/ and lists the members: the product repository itself for a single-repository product, <product>-hub for one spread over several repositories. A member repository names the primary.",
14302
+ "description": "The product whose version sequence this repository shares. The primary repository holds the Release Plans under releases/ and lists the members: the product repository itself for a single-repository product, <product>-hub for one spread over several repositories. A member repository names the primary. A repository of the organization layer leaves it out; every other repository writes it.",
12638
14303
  "oneOf": [
12639
14304
  {
12640
14305
  "title": "primary",
@@ -12682,7 +14347,7 @@
12682
14347
  "$ref": "#/definitions/access"
12683
14348
  },
12684
14349
  "scope": {
12685
- "description": "npm scope of the restricted packages, e.g. \"@my-org\". Required when this repository or any unit is restricted.",
14350
+ "description": "npm scope of the restricted packages, e.g. \"@your-org\". Required when this repository or any unit is restricted.",
12686
14351
  "type": "string",
12687
14352
  "pattern": "^@[a-z0-9][a-z0-9._-]*$"
12688
14353
  },
@@ -12700,6 +14365,13 @@
12700
14365
  "additionalProperties": {
12701
14366
  "$ref": "#/definitions/unit"
12702
14367
  }
14368
+ },
14369
+ "layer": {
14370
+ "description": "The repository layer: organization for a repository the whole organization shares, product for one that belongs to a product. Left out, it is product. It is not the layer of fact-kit, nor a layer of the placement rules.",
14371
+ "enum": [
14372
+ "organization",
14373
+ "product"
14374
+ ]
12703
14375
  }
12704
14376
  },
12705
14377
  "definitions": {
@@ -12813,6 +14485,10 @@
12813
14485
  "type": "string",
12814
14486
  "pattern": "^[a-z0-9][a-z0-9._-]*$"
12815
14487
  }
14488
+ },
14489
+ "independent": {
14490
+ "description": "When true, the unit releases on its own and does not follow the product line's cadence. A release train whose units are all independent does not carry the repository's aggregate packages (facts and docs); one non-independent unit on the train brings them in.",
14491
+ "type": "boolean"
12816
14492
  }
12817
14493
  },
12818
14494
  "allOf": [
@@ -12859,7 +14535,7 @@
12859
14535
  }
12860
14536
  },
12861
14537
  {
12862
- "since": "0.4.0",
14538
+ "since": "0.11.0",
12863
14539
  "content": {
12864
14540
  "schema": {
12865
14541
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -13165,6 +14841,9 @@
13165
14841
  "independent": {
13166
14842
  "description": "When true, the unit releases on its own and does not follow the product line's cadence. A release train whose units are all independent does not carry the repository's aggregate packages (facts and docs); one non-independent unit on the train brings them in.",
13167
14843
  "type": "boolean"
14844
+ },
14845
+ "publish": {
14846
+ "$ref": "#/definitions/publish"
13168
14847
  }
13169
14848
  },
13170
14849
  "allOf": [
@@ -13203,6 +14882,139 @@
13203
14882
  ]
13204
14883
  }
13205
14884
  }
14885
+ },
14886
+ {
14887
+ "description": "A unit that publishes executables is a package.",
14888
+ "if": {
14889
+ "required": [
14890
+ "publish"
14891
+ ],
14892
+ "properties": {
14893
+ "publish": {
14894
+ "required": [
14895
+ "to"
14896
+ ],
14897
+ "properties": {
14898
+ "to": {
14899
+ "const": "binary"
14900
+ }
14901
+ }
14902
+ }
14903
+ }
14904
+ },
14905
+ "then": {
14906
+ "properties": {
14907
+ "kind": {
14908
+ "const": "package"
14909
+ }
14910
+ }
14911
+ }
14912
+ },
14913
+ {
14914
+ "description": "A unit that publishes a container image is a service or a backend.",
14915
+ "if": {
14916
+ "required": [
14917
+ "publish"
14918
+ ],
14919
+ "properties": {
14920
+ "publish": {
14921
+ "required": [
14922
+ "to"
14923
+ ],
14924
+ "properties": {
14925
+ "to": {
14926
+ "const": "image"
14927
+ }
14928
+ }
14929
+ }
14930
+ }
14931
+ },
14932
+ "then": {
14933
+ "properties": {
14934
+ "kind": {
14935
+ "enum": [
14936
+ "service",
14937
+ "backend"
14938
+ ]
14939
+ }
14940
+ }
14941
+ }
14942
+ }
14943
+ ]
14944
+ },
14945
+ "publish": {
14946
+ "description": "Where the unit is published. Left out, the target follows the files of the unit.",
14947
+ "type": "object",
14948
+ "required": [
14949
+ "to"
14950
+ ],
14951
+ "additionalProperties": false,
14952
+ "properties": {
14953
+ "to": {
14954
+ "description": "binary: a compiled executable released to the public release repository. image: a container image pushed to ghcr. none: the unit is not published.",
14955
+ "enum": [
14956
+ "binary",
14957
+ "image",
14958
+ "none"
14959
+ ]
14960
+ },
14961
+ "command": {
14962
+ "description": "The name of the executable and of its formula. Required for binary.",
14963
+ "type": "string",
14964
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
14965
+ },
14966
+ "description": {
14967
+ "description": "One line that says what the executable does, written into the formula. Required for binary.",
14968
+ "type": "string",
14969
+ "minLength": 1
14970
+ },
14971
+ "platforms": {
14972
+ "description": "The platforms to build for, as <os>/<arch>, for example linux/amd64. Required for binary and image.",
14973
+ "type": "array",
14974
+ "minItems": 1,
14975
+ "uniqueItems": true,
14976
+ "items": {
14977
+ "type": "string",
14978
+ "pattern": "^[a-z0-9]+/[a-z0-9]+$"
14979
+ }
14980
+ }
14981
+ },
14982
+ "allOf": [
14983
+ {
14984
+ "if": {
14985
+ "required": [
14986
+ "to"
14987
+ ],
14988
+ "properties": {
14989
+ "to": {
14990
+ "const": "binary"
14991
+ }
14992
+ }
14993
+ },
14994
+ "then": {
14995
+ "required": [
14996
+ "command",
14997
+ "description",
14998
+ "platforms"
14999
+ ]
15000
+ }
15001
+ },
15002
+ {
15003
+ "if": {
15004
+ "required": [
15005
+ "to"
15006
+ ],
15007
+ "properties": {
15008
+ "to": {
15009
+ "const": "image"
15010
+ }
15011
+ }
15012
+ },
15013
+ "then": {
15014
+ "required": [
15015
+ "platforms"
15016
+ ]
15017
+ }
13206
15018
  }
13207
15019
  ]
13208
15020
  }
@@ -13519,6 +15331,9 @@
13519
15331
  "independent": {
13520
15332
  "description": "When true, the unit releases on its own and does not follow the product line's cadence. A release train whose units are all independent does not carry the repository's aggregate packages (facts and docs); one non-independent unit on the train brings them in.",
13521
15333
  "type": "boolean"
15334
+ },
15335
+ "publish": {
15336
+ "$ref": "#/definitions/publish"
13522
15337
  }
13523
15338
  },
13524
15339
  "allOf": [
@@ -13557,6 +15372,139 @@
13557
15372
  ]
13558
15373
  }
13559
15374
  }
15375
+ },
15376
+ {
15377
+ "description": "A unit that publishes executables is a package.",
15378
+ "if": {
15379
+ "required": [
15380
+ "publish"
15381
+ ],
15382
+ "properties": {
15383
+ "publish": {
15384
+ "required": [
15385
+ "to"
15386
+ ],
15387
+ "properties": {
15388
+ "to": {
15389
+ "const": "binary"
15390
+ }
15391
+ }
15392
+ }
15393
+ }
15394
+ },
15395
+ "then": {
15396
+ "properties": {
15397
+ "kind": {
15398
+ "const": "package"
15399
+ }
15400
+ }
15401
+ }
15402
+ },
15403
+ {
15404
+ "description": "A unit that publishes a container image is a service or a backend.",
15405
+ "if": {
15406
+ "required": [
15407
+ "publish"
15408
+ ],
15409
+ "properties": {
15410
+ "publish": {
15411
+ "required": [
15412
+ "to"
15413
+ ],
15414
+ "properties": {
15415
+ "to": {
15416
+ "const": "image"
15417
+ }
15418
+ }
15419
+ }
15420
+ }
15421
+ },
15422
+ "then": {
15423
+ "properties": {
15424
+ "kind": {
15425
+ "enum": [
15426
+ "service",
15427
+ "backend"
15428
+ ]
15429
+ }
15430
+ }
15431
+ }
15432
+ }
15433
+ ]
15434
+ },
15435
+ "publish": {
15436
+ "description": "Where the unit is published. Left out, the target follows the files of the unit.",
15437
+ "type": "object",
15438
+ "required": [
15439
+ "to"
15440
+ ],
15441
+ "additionalProperties": false,
15442
+ "properties": {
15443
+ "to": {
15444
+ "description": "binary: a compiled executable released to the public release repository. image: a container image pushed to ghcr. none: the unit is not published.",
15445
+ "enum": [
15446
+ "binary",
15447
+ "image",
15448
+ "none"
15449
+ ]
15450
+ },
15451
+ "command": {
15452
+ "description": "The name of the executable and of its formula. Required for binary.",
15453
+ "type": "string",
15454
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
15455
+ },
15456
+ "description": {
15457
+ "description": "One line that says what the executable does, written into the formula. Required for binary.",
15458
+ "type": "string",
15459
+ "minLength": 1
15460
+ },
15461
+ "platforms": {
15462
+ "description": "The platforms to build for, as <os>/<arch>, for example linux/amd64. Required for binary and image.",
15463
+ "type": "array",
15464
+ "minItems": 1,
15465
+ "uniqueItems": true,
15466
+ "items": {
15467
+ "type": "string",
15468
+ "pattern": "^[a-z0-9]+/[a-z0-9]+$"
15469
+ }
15470
+ }
15471
+ },
15472
+ "allOf": [
15473
+ {
15474
+ "if": {
15475
+ "required": [
15476
+ "to"
15477
+ ],
15478
+ "properties": {
15479
+ "to": {
15480
+ "const": "binary"
15481
+ }
15482
+ }
15483
+ },
15484
+ "then": {
15485
+ "required": [
15486
+ "command",
15487
+ "description",
15488
+ "platforms"
15489
+ ]
15490
+ }
15491
+ },
15492
+ {
15493
+ "if": {
15494
+ "required": [
15495
+ "to"
15496
+ ],
15497
+ "properties": {
15498
+ "to": {
15499
+ "const": "image"
15500
+ }
15501
+ }
15502
+ },
15503
+ "then": {
15504
+ "required": [
15505
+ "platforms"
15506
+ ]
15507
+ }
13560
15508
  }
13561
15509
  ]
13562
15510
  }
@@ -15015,6 +16963,28 @@
15015
16963
  "exitStatus": "0 consistent, 1 not, 2 wrong arguments"
15016
16964
  }
15017
16965
  }
16966
+ },
16967
+ {
16968
+ "since": "0.11.0",
16969
+ "content": {
16970
+ "value": {
16971
+ "file": "release/scripts/ci/check-release-policy.sh",
16972
+ "role": "release",
16973
+ "usage": "check-release-policy.sh [--policy <file>] [--config <file>]",
16974
+ "sameAsTemplate": "Every argument of the template this one grew out of keeps its name and meaning",
16975
+ "checks": [
16976
+ "the units of the policy are exactly the components of release-please-config.json; on a release branch the policy may list units the shrunk config no longer has",
16977
+ "the unit directory an index.ts under facts/ passes to describesOf(<component>, <dir>) is the path of that component in release-please-config.json; a missing directory or a different one fails, and on a release branch whose config was shrunk to the train a component the config no longer has is skipped",
16978
+ "a unit that deploys (service, backend, web) finds a target for each stage it walks, and walks at least one prerelease stage when its targets have one; a unit whose publish.to is image is left out of this check and needs no targets",
16979
+ "a unit that ships to store channels (mobile, desktop) names a channel for each stage it walks",
16980
+ "every dependsOn names a unit the policy lists",
16981
+ "a unit whose publish.to is binary has the kind package, names command, description and platforms, and has a go.mod in its directory; a unit without go.mod fails and the message names the reason (this version supports Go only)",
16982
+ "a unit whose publish.to is image has the kind service or backend and names platforms"
16983
+ ],
16984
+ "hub": "A hub has no units and no release-please-config.json, so it passes.",
16985
+ "exitStatus": "0 consistent, 1 not, 2 wrong arguments"
16986
+ }
16987
+ }
15018
16988
  }
15019
16989
  ],
15020
16990
  "source": {
@@ -15029,9 +16999,11 @@
15029
16999
  "checks": [
15030
17000
  "the units of the policy are exactly the components of release-please-config.json; on a release branch the policy may list units the shrunk config no longer has",
15031
17001
  "the unit directory an index.ts under facts/ passes to describesOf(<component>, <dir>) is the path of that component in release-please-config.json; a missing directory or a different one fails, and on a release branch whose config was shrunk to the train a component the config no longer has is skipped",
15032
- "a unit that deploys (service, backend, web) finds a target for each stage it walks, and walks at least one prerelease stage when its targets have one",
17002
+ "a unit that deploys (service, backend, web) finds a target for each stage it walks, and walks at least one prerelease stage when its targets have one; a unit whose publish.to is image is left out of this check and needs no targets",
15033
17003
  "a unit that ships to store channels (mobile, desktop) names a channel for each stage it walks",
15034
- "every dependsOn names a unit the policy lists"
17004
+ "every dependsOn names a unit the policy lists",
17005
+ "a unit whose publish.to is binary has the kind package, names command, description and platforms, and has a go.mod in its directory; a unit without go.mod fails and the message names the reason (this version supports Go only)",
17006
+ "a unit whose publish.to is image has the kind service or backend and names platforms"
15035
17007
  ],
15036
17008
  "hub": "A hub has no units and no release-please-config.json, so it passes.",
15037
17009
  "exitStatus": "0 consistent, 1 not, 2 wrong arguments"
@@ -17853,6 +19825,24 @@
17853
19825
  "paths": "only packages/*, libs/*, facts and docs are dispatched"
17854
19826
  }
17855
19827
  }
19828
+ },
19829
+ {
19830
+ "since": "0.11.0",
19831
+ "content": {
19832
+ "value": {
19833
+ "script": "release/scripts/release/dispatch-publish.sh",
19834
+ "role": "release",
19835
+ "calledBy": "the step \"Dispatch publish for released packages\" of release/.github/workflows/release-please.yml",
19836
+ "rule": "The packages a release created are grouped by the stage of the version each has in .release-please-manifest.json (version_stage: ga when there is no prerelease mark, else alpha, beta or rc), and publish.yml is dispatched once per group in the order alpha, beta, rc, ga with that stage.",
19837
+ "why": "The units of one release line may stand at different stages, and publish-units.sh stops when a version does not belong to the stage it is given.",
19838
+ "env": [
19839
+ "PATHS (paths_released of release-please, a JSON array)",
19840
+ "GH_TOKEN",
19841
+ "GITHUB_REF_NAME"
19842
+ ],
19843
+ "paths": "packages/*, libs/*, facts and docs are dispatched, and so is a unit whose publish.to in release-policy.json is binary or image, wherever its directory is, for example under services/ (blueprint-shared.publishing.target-selection). A service without publish.to is not dispatched."
19844
+ }
19845
+ }
17856
19846
  }
17857
19847
  ],
17858
19848
  "source": {
@@ -17870,7 +19860,7 @@
17870
19860
  "GH_TOKEN",
17871
19861
  "GITHUB_REF_NAME"
17872
19862
  ],
17873
- "paths": "only packages/*, libs/*, facts and docs are dispatched"
19863
+ "paths": "packages/*, libs/*, facts and docs are dispatched, and so is a unit whose publish.to in release-policy.json is binary or image, wherever its directory is, for example under services/ (blueprint-shared.publishing.target-selection). A service without publish.to is not dispatched."
17874
19864
  }
17875
19865
  }
17876
19866
  },
@@ -19801,6 +21791,91 @@
19801
21791
  }
19802
21792
  }
19803
21793
  }
21794
+ },
21795
+ {
21796
+ "since": "0.11.0",
21797
+ "content": {
21798
+ "value": {
21799
+ "level": "repository",
21800
+ "variable": "the clientIdVariable of blueprint-shared.templates.github-app, a repository variable",
21801
+ "secret": "the privateKeySecret of blueprint-shared.templates.github-app, a repository secret",
21802
+ "reason": "A private repository on a plan that cannot read an organization variable or secret (an organization on the GitHub Free plan is one) needs both values in the repository. A public repository sets them in the repository as well, the same as the template. The expressions vars.<name> and secrets.<name> read the same in both levels, so the workflows do not change.",
21803
+ "setIn": "Every repository whose workflows mint the App token sets both values itself. A repository that lacks them cannot use the token of another repository.",
21804
+ "rule": "Every composed repository has the role base, whose auto-merge.yml mints the App token, so every composed repository sets both values. A repository sets the values when one of its roles is in rules. A new role or workflow that reads the clientIdVariable adds its role to rules.",
21805
+ "howToSet": [
21806
+ "gh variable set <clientIdVariable> -R <owner/repo>",
21807
+ "gh secret set <privateKeySecret> -R <owner/repo>"
21808
+ ],
21809
+ "rules": [
21810
+ {
21811
+ "role": "base",
21812
+ "workflows": [
21813
+ "auto-merge.yml: job merge"
21814
+ ]
21815
+ },
21816
+ {
21817
+ "role": "release",
21818
+ "workflows": [
21819
+ "advance-release.yml: job advance",
21820
+ "merge-release-pr.yml: job merge",
21821
+ "merge-back.yml: job merge-back",
21822
+ "release-please.yml: jobs release-please and merge-back",
21823
+ "open-release-line.yml: job open",
21824
+ "sync-release-tools.yml: job sync",
21825
+ "close-release.yml: job close (the App token is made only after the decision says ready)"
21826
+ ]
21827
+ },
21828
+ {
21829
+ "role": "publish",
21830
+ "workflows": [
21831
+ "publish.yml: jobs mirror and binary (the other jobs use GITHUB_TOKEN or Trusted Publishing, and the image job uses GITHUB_TOKEN because the App has no packages permission)"
21832
+ ]
21833
+ },
21834
+ {
21835
+ "role": "deploy",
21836
+ "workflows": [
21837
+ "deploy-prerelease.yml: job bundle",
21838
+ "deploy-prod.yml: job release"
21839
+ ]
21840
+ },
21841
+ {
21842
+ "role": "ops",
21843
+ "workflows": [
21844
+ "ops-deploy.yml: job iac (the token reads the private OpenTofu modules, contents: read)",
21845
+ "ops-deploy.yml: job workloads (the token reads the bundles, contents: read)"
21846
+ ]
21847
+ },
21848
+ {
21849
+ "role": "hub",
21850
+ "workflows": [
21851
+ "open-release-lines.yml: job dispatch (dispatches the workflows of the member repositories)"
21852
+ ]
21853
+ },
21854
+ {
21855
+ "role": "verify",
21856
+ "workflows": [
21857
+ "verify-prod.yml: job verify"
21858
+ ]
21859
+ },
21860
+ {
21861
+ "role": "org",
21862
+ "workflows": [
21863
+ "none: the role adds a check script and a step of the facts job of ci.yml, and neither mints the token"
21864
+ ]
21865
+ }
21866
+ ],
21867
+ "permissions": {
21868
+ "repository": "Contents (write), Pull requests (write), Issues (write), Workflows (write) and Actions (read); Actions (write) where a workflow dispatches another one; Checks (read), Statuses (read) and Variables (read).",
21869
+ "contents": "push of the pin, sync, product and merge-back commits, the product tag and the deletion of the branches; checkout of the release branch with the token",
21870
+ "pullRequests": "opening and merging the merge-back PR, and merging a Release PR",
21871
+ "issues": "release-please puts labels on its PRs, and PR labels go through the Issues API",
21872
+ "workflows": "sync-release-tools.yml pushes the changes of .github/workflows to the release branches. A push that changes a file under .github/workflows is refused for a token without this permission (\"refusing to allow a GitHub App to create or update workflow ... without `workflows` permission\"), and the token of GITHUB_TOKEN does not have it either. Observed on 2026-11-10 in the demo organization: the App with workflows: write pushed it, GITHUB_TOKEN was refused.",
21873
+ "comment": "The permissions are also written in the comment of the app-token step of release/.github/workflows/release-please.yml.",
21874
+ "actions": "The release scripts list workflow runs with gh run list (scripts/lib/release-pr.sh, release_please_settled), which needs Actions (read). A token without it makes the call fail, and the release stops. Observed on 2026-11-13 in an adopting organization: the merge-release-pr.yml run 43367045052 failed because the bot of the App had no Actions (read).",
21875
+ "binaryRelease": "The binary job of publish.yml makes the token for the repository of binaryReleaseRepository only, with permission-contents: write (blueprint-shared.publishing.binary-release). The App has to be installed on that repository."
21876
+ }
21877
+ }
21878
+ }
19804
21879
  }
19805
21880
  ],
19806
21881
  "source": {
@@ -19840,7 +21915,7 @@
19840
21915
  {
19841
21916
  "role": "publish",
19842
21917
  "workflows": [
19843
- "publish.yml: job mirror (the other jobs use GITHUB_TOKEN or Trusted Publishing)"
21918
+ "publish.yml: jobs mirror and binary (the other jobs use GITHUB_TOKEN or Trusted Publishing, and the image job uses GITHUB_TOKEN because the App has no packages permission)"
19844
21919
  ]
19845
21920
  },
19846
21921
  {
@@ -19883,7 +21958,8 @@
19883
21958
  "issues": "release-please puts labels on its PRs, and PR labels go through the Issues API",
19884
21959
  "workflows": "sync-release-tools.yml pushes the changes of .github/workflows to the release branches. A push that changes a file under .github/workflows is refused for a token without this permission (\"refusing to allow a GitHub App to create or update workflow ... without `workflows` permission\"), and the token of GITHUB_TOKEN does not have it either. Observed on 2026-11-10 in the demo organization: the App with workflows: write pushed it, GITHUB_TOKEN was refused.",
19885
21960
  "comment": "The permissions are also written in the comment of the app-token step of release/.github/workflows/release-please.yml.",
19886
- "actions": "The release scripts list workflow runs with gh run list (scripts/lib/release-pr.sh, release_please_settled), which needs Actions (read). A token without it makes the call fail, and the release stops. Observed on 2026-11-13 in an adopting organization: the merge-release-pr.yml run 43367045052 failed because the bot of the App had no Actions (read)."
21961
+ "actions": "The release scripts list workflow runs with gh run list (scripts/lib/release-pr.sh, release_please_settled), which needs Actions (read). A token without it makes the call fail, and the release stops. Observed on 2026-11-13 in an adopting organization: the merge-release-pr.yml run 43367045052 failed because the bot of the App had no Actions (read).",
21962
+ "binaryRelease": "The binary job of publish.yml makes the token for the repository of binaryReleaseRepository only, with permission-contents: write (blueprint-shared.publishing.binary-release). The App has to be installed on that repository."
19887
21963
  }
19888
21964
  }
19889
21965
  }
@@ -20247,6 +22323,144 @@
20247
22323
  }
20248
22324
  ]
20249
22325
  }
22326
+ },
22327
+ {
22328
+ "since": "0.11.0",
22329
+ "content": {
22330
+ "value": [
22331
+ {
22332
+ "name": "clientIdVariable",
22333
+ "meaning": "The name of the repository variable that holds the client id of the GitHub App whose token the workflows mint. Each organization chooses it, and the same name is used in every repository that has the role base.",
22334
+ "form": "the placeholder @@clientIdVariable@@ in the workflow files; the compose step writes the name in",
22335
+ "usedBy": [
22336
+ "base/.github/workflows/auto-merge.yml",
22337
+ "deploy/.github/workflows/deploy-prerelease.yml",
22338
+ "deploy/.github/workflows/deploy-prod.yml",
22339
+ "hub/.github/workflows/open-release-lines.yml",
22340
+ "ops/.github/workflows/ops-deploy.yml",
22341
+ "publish/.github/workflows/publish.yml",
22342
+ "release/.github/workflows/advance-release.yml",
22343
+ "release/.github/workflows/close-release.yml",
22344
+ "release/.github/workflows/merge-back.yml",
22345
+ "release/.github/workflows/merge-release-pr.yml",
22346
+ "release/.github/workflows/open-release-line.yml",
22347
+ "release/.github/workflows/release-please.yml",
22348
+ "release/.github/workflows/sync-release-tools.yml",
22349
+ "verify/.github/workflows/verify-prod.yml"
22350
+ ]
22351
+ },
22352
+ {
22353
+ "name": "privateKeySecret",
22354
+ "meaning": "The name of the repository secret that holds the private key of the same GitHub App. Each organization chooses it.",
22355
+ "form": "the placeholder @@privateKeySecret@@ in the workflow files; the compose step writes the name in",
22356
+ "usedBy": [
22357
+ "base/.github/workflows/auto-merge.yml",
22358
+ "deploy/.github/workflows/deploy-prerelease.yml",
22359
+ "deploy/.github/workflows/deploy-prod.yml",
22360
+ "hub/.github/workflows/open-release-lines.yml",
22361
+ "ops/.github/workflows/ops-deploy.yml",
22362
+ "publish/.github/workflows/publish.yml",
22363
+ "release/.github/workflows/advance-release.yml",
22364
+ "release/.github/workflows/close-release.yml",
22365
+ "release/.github/workflows/merge-back.yml",
22366
+ "release/.github/workflows/merge-release-pr.yml",
22367
+ "release/.github/workflows/open-release-line.yml",
22368
+ "release/.github/workflows/release-please.yml",
22369
+ "release/.github/workflows/sync-release-tools.yml",
22370
+ "verify/.github/workflows/verify-prod.yml"
22371
+ ]
22372
+ },
22373
+ {
22374
+ "name": "mergeLabel",
22375
+ "meaning": "The name of the pull request label that asks the auto-merge workflow to merge. The compose step also writes the same label into scripts/merge/merge-config.json of the composed repository, so the workflow and the decision script read one name.",
22376
+ "form": "the placeholder @@mergeLabel@@ in the workflow file",
22377
+ "usedBy": [
22378
+ "base/.github/workflows/auto-merge.yml"
22379
+ ]
22380
+ },
22381
+ {
22382
+ "name": "scope",
22383
+ "meaning": "The npm scope of the restricted (non-public) packages a repository publishes, such as @<organization>. It is required when the repository or any unit is restricted.",
22384
+ "form": "the placeholder @@scope@@ as the value of the key scope; the compose step writes the scope in",
22385
+ "usedBy": [
22386
+ "release/release-policy.json",
22387
+ "org/README.md"
22388
+ ]
22389
+ },
22390
+ {
22391
+ "name": "licenseHolder",
22392
+ "meaning": "The copyright holder named after the year in the first line of the license text.",
22393
+ "form": "the placeholder @@licenseHolder@@ in the file; the compose step writes the name in",
22394
+ "usedBy": [
22395
+ "base/LICENSE"
22396
+ ]
22397
+ },
22398
+ {
22399
+ "name": "mergeBotApp",
22400
+ "meaning": "The name (slug) of the GitHub App whose bot account is the commit author of writeback-ops.sh (field mergeBotApp of blueprint-shared.org-values). The author is <mergeBotUserId>+<mergeBotApp>[bot].",
22401
+ "form": "the placeholder @@mergeBotApp@@ in the file; the compose step writes the name in",
22402
+ "usedBy": [
22403
+ "deploy/scripts/deploy/writeback-ops.sh"
22404
+ ]
22405
+ },
22406
+ {
22407
+ "name": "mergeBotUserId",
22408
+ "meaning": "The numeric user id of the bot account of that App (field mergeBotUserId of blueprint-shared.org-values). GitHub links a commit to the bot only when the address is <id>+<slug>[bot]@users.noreply.github.com.",
22409
+ "form": "the placeholder @@mergeBotUserId@@ in the file; the compose step writes the id in",
22410
+ "usedBy": [
22411
+ "deploy/scripts/deploy/writeback-ops.sh"
22412
+ ]
22413
+ },
22414
+ {
22415
+ "name": "organization",
22416
+ "meaning": "The name of the organization, which is its npm scope without the @. The compose step works it out from the scope, so an organization does not give it.",
22417
+ "form": "the placeholder @@organization@@ in the file; the compose step writes the name in",
22418
+ "usedBy": [
22419
+ "org/README.md"
22420
+ ]
22421
+ },
22422
+ {
22423
+ "name": "repoName",
22424
+ "meaning": "The name of the repository that is composed (blueprint-shared.naming.repo-name). The org role names its facts and docs packages and the path of its documents from it.",
22425
+ "form": "the placeholder @@repoName@@ in the file; the compose step writes the name in",
22426
+ "usedBy": [
22427
+ "org/README.md"
22428
+ ]
22429
+ },
22430
+ {
22431
+ "name": "aggregatePackageName",
22432
+ "meaning": "The name of the facts aggregate package of the organization (field aggregatePackageName of blueprint-shared.org-values).",
22433
+ "form": "the placeholder @@aggregatePackageName@@ in the file; the compose step writes the name in",
22434
+ "usedBy": [
22435
+ "org/README.md"
22436
+ ]
22437
+ },
22438
+ {
22439
+ "name": "aggregateRegistry",
22440
+ "meaning": "The name of the registry that the scoped packages of the organization are published to (field aggregateRegistry of blueprint-shared.org-values).",
22441
+ "form": "the placeholder @@aggregateRegistry@@ in the file; the compose step writes the name in",
22442
+ "usedBy": [
22443
+ "org/README.md"
22444
+ ]
22445
+ },
22446
+ {
22447
+ "name": "binaryReleaseRepository",
22448
+ "meaning": "The name of the public repository that receives the executable releases and the formula of the units whose publish.to is binary (field binaryReleaseRepository of blueprint-shared.org-values), the repository name only, without the owner, which is the owner of the source repository. Optional: only a repository that has such a unit fills it. Without a value the compose step writes an empty string, and the binary job stops at its first step and writes the reason.",
22449
+ "form": "the placeholder @@binaryReleaseRepository@@ in the workflow file; the compose step writes the name in",
22450
+ "usedBy": [
22451
+ "publish/.github/workflows/publish.yml"
22452
+ ]
22453
+ },
22454
+ {
22455
+ "name": "dockerRunnerLabel",
22456
+ "meaning": "The runs-on label of the image job of publish.yml (the docker label of selfHostedRunnerLabels in blueprint-shared.org-values). When the organization gives no docker label, the compose step writes the default label of selfHostedRunnerLabels (self-hosted-linux when that is not given either), and image-units.sh stops and writes the reason if the runner has no docker. A public repository gets ubuntu-latest.",
22457
+ "form": "the placeholder @@dockerRunnerLabel@@ in quotes as the value of runs-on in the workflow file (runs-on: \"@@dockerRunnerLabel@@\", because a bare @ does not start a YAML value); the compose step writes the label in",
22458
+ "usedBy": [
22459
+ "publish/.github/workflows/publish.yml"
22460
+ ]
22461
+ }
22462
+ ]
22463
+ }
20250
22464
  }
20251
22465
  ],
20252
22466
  "source": {
@@ -20368,6 +22582,22 @@
20368
22582
  "usedBy": [
20369
22583
  "org/README.md"
20370
22584
  ]
22585
+ },
22586
+ {
22587
+ "name": "binaryReleaseRepository",
22588
+ "meaning": "The name of the public repository that receives the executable releases and the formula of the units whose publish.to is binary (field binaryReleaseRepository of blueprint-shared.org-values), the repository name only, without the owner, which is the owner of the source repository. Optional: only a repository that has such a unit fills it. Without a value the compose step writes an empty string, and the binary job stops at its first step and writes the reason.",
22589
+ "form": "the placeholder @@binaryReleaseRepository@@ in the workflow file; the compose step writes the name in",
22590
+ "usedBy": [
22591
+ "publish/.github/workflows/publish.yml"
22592
+ ]
22593
+ },
22594
+ {
22595
+ "name": "dockerRunnerLabel",
22596
+ "meaning": "The runs-on label of the image job of publish.yml (the docker label of selfHostedRunnerLabels in blueprint-shared.org-values). When the organization gives no docker label, the compose step writes the default label of selfHostedRunnerLabels (self-hosted-linux when that is not given either), and image-units.sh stops and writes the reason if the runner has no docker. A public repository gets ubuntu-latest.",
22597
+ "form": "the placeholder @@dockerRunnerLabel@@ in quotes as the value of runs-on in the workflow file (runs-on: \"@@dockerRunnerLabel@@\", because a bare @ does not start a YAML value); the compose step writes the label in",
22598
+ "usedBy": [
22599
+ "publish/.github/workflows/publish.yml"
22600
+ ]
20371
22601
  }
20372
22602
  ]
20373
22603
  }