11name : Publish packages
22
3- # GENERATED by scripts/gen-publish-workflow.ts — do not edit by hand.
4- # Run `deno task gen:publish-workflow` after adding/removing a workspace
5- # package or changing its @executablemd dependencies, then commit the result.
6- #
7- # One tag ships everything: release.yml builds the binary; this workflow fans
8- # out one publish-one.yml run per @executablemd package, ordered with `needs:`
9- # so dependencies publish before dependents (leaves run in parallel).
10- #
11- # Prerequisites (one-time) — see .github/PUBLISHING.md:
12- # - npm: an OIDC trusted publisher per @executablemd package. The workflow
13- # filename npm validates is the CALLER (publish-packages.yml), not the
14- # reusable publish-one.yml. No npm token is used.
15- # - JSR: create/link the @executablemd packages to this repo (best-effort).
16- #
17- # Note for consumers: core/runtime/cli depend on effection's 4.x prerelease,
18- # which npm's peer resolver rejects against @effectionx/* (`^3 || ^4`). Until
19- # effection 4 is stable, installing those packages needs `--legacy-peer-deps`.
3+ # GENERATED by scripts/gen-publish-workflow.md — do not edit by hand.
4+ # Run `deno task gen:publish-workflow` and commit the result.
5+ # See specs/release-process-spec.md.
206
217on :
228 push :
239 tags : ["v*"]
24- workflow_dispatch :
25- inputs :
26- tag :
27- description : " Tag to publish (e.g. v0.2.0)"
28- required : true
2910
3011permissions :
3112 contents : read
13+ actions : read # the version job polls the release.yml run
3214 id-token : write # granted to the reusable publish-one.yml jobs for OIDC
3315
3416jobs :
@@ -37,11 +19,48 @@ jobs:
3719 outputs :
3820 value : ${{ steps.resolve.outputs.value }}
3921 steps :
22+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
23+
4024 - id : resolve
4125 run : |
42- TAG="${{ github.event.inputs.tag || github. ref_name }}"
26+ TAG="${{ github.ref_name }}"
4327 echo "value=${TAG#v}" >> "$GITHUB_OUTPUT"
4428
29+ # Refuse a tag the manifests do not declare (spec §2).
30+ - name : Validate the manifests declare this version
31+ run : |
32+ VERSION="${{ steps.resolve.outputs.value }}"
33+ for f in durable-streams/deno.json runtime/deno.json core/deno.json cli/deno.json packages/code-review-agent/deno.json; do
34+ declared="$(jq -r .version "$f")"
35+ if [ "$declared" != "$VERSION" ]; then
36+ echo "::error::$f declares $declared, not $VERSION — the tag does not match the manifests"
37+ exit 1
38+ fi
39+ done
40+
41+ # Packages publish only after the binaries exist (spec §1): poll the
42+ # release.yml run for this commit and fail if it fails.
43+ - name : Wait for the binary release to succeed
44+ env :
45+ GH_TOKEN : ${{ github.token }}
46+ run : |
47+ for i in $(seq 1 60); do
48+ RUNS="repos/${{ github.repository }}/actions/workflows/release.yml/runs?head_sha=${{ github.sha }}&per_page=1"
49+ STATUS="$(gh api "$RUNS" --jq '.workflow_runs[0].status // "queued"')"
50+ CONCLUSION="$(gh api "$RUNS" --jq '.workflow_runs[0].conclusion // "none"')"
51+ if [ "$STATUS" = "completed" ]; then
52+ if [ "$CONCLUSION" = "success" ]; then
53+ echo "release.yml succeeded — binaries are published"
54+ exit 0
55+ fi
56+ echo "::error::release.yml concluded '$CONCLUSION' — refusing to publish packages without binaries"
57+ exit 1
58+ fi
59+ sleep 30
60+ done
61+ echo "::error::timed out waiting for release.yml"
62+ exit 1
63+
4564 durable-streams :
4665 needs : [version]
4766 uses : ./.github/workflows/publish-one.yml
0 commit comments