Skip to content

Commit 94fdac2

Browse files
Attach the tarballs before the Release publishes, because published means frozen (#166)
Releases are immutable here: the step now creates the Release as a draft with the smoked tarballs attached, then publishes by the draft's id. A rerun that finds it already published succeeds with nothing to repair. deferred.md records the assetless v8.0.0-rc.1 and its repair path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
1 parent c5fe09d commit 94fdac2

2 files changed

Lines changed: 49 additions & 16 deletions

File tree

.drive/projects/prisma-cli-v8/deferred.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ Work identified during a slice that is not part of that slice's
44
contract. Each entry: what, why it was deferred, where it lands.
55
Nothing here is tracked outside this file.
66

7+
## After S7's first real publish
8+
9+
- **The `v8.0.0-rc.1` GitHub Release has no tarballs attached, and
10+
none can be added.** The first real `next` publish (2026-08-12, run
11+
31618278670) published both packages to npm successfully, then the
12+
Release step published the Release before uploading assets — and this
13+
repo's releases are immutable, so the upload was refused (HTTP 422)
14+
and the Release froze empty. npm is unaffected; the smoked tarballs
15+
remain retrievable from that run's workflow artifacts (which expire
16+
on the repo's retention schedule) and from npm itself. PR #165 fixes
17+
the step for every future release (draft → attach assets → publish,
18+
the order GitHub's own docs recommend). Repairing rc.1's Release
19+
itself, if ever wanted: merge #165 first, try
20+
`gh release delete v8.0.0-rc.1` (docs are silent on whether a
21+
published immutable release can be deleted; the attempt is the test),
22+
and if deletion works, re-dispatch the publish workflow — the
23+
already-published npm versions are tolerated and the run recreates
24+
the Release complete. Operator ruling (2026-08-12): cosmetic, not
25+
immediate.
26+
727
## Still open after S3/D4 — mostly the composer repo, two items need both
828

929
D4 landed the prisma-cli half (the mount, the node floor, the divergence

.github/workflows/publish.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,30 +194,43 @@ jobs:
194194
# changelog signal. The Release is created at $GITHUB_SHA so the
195195
# tag points at the same commit the publish ran from.
196196
#
197-
# Idempotent on workflow rerun: if a Release for `v$VERSION` already
198-
# exists (e.g. a previous run published to npm but failed before this
199-
# step), edit it in place rather than re-creating it.
197+
# This repo's releases are immutable: once published, neither the
198+
# assets nor the tag can change (uploading to a published release
199+
# answers HTTP 422). So the Release is created as a DRAFT with the
200+
# smoked tarballs already attached, then published — assets first,
201+
# publish second. On a rerun that finds the Release already
202+
# published there is nothing left to repair; the step says so and
203+
# succeeds.
200204
- name: Create GitHub Release
201205
if: ${{ steps.version.outputs.publish == 'true' && steps.version.outputs.release == 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry-run != 'true') }}
202206
env:
203207
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
204208
VERSION: ${{ steps.version.outputs.version }}
205209
run: |
210+
if gh release view "v$VERSION" >/dev/null 2>&1; then
211+
echo "Release v$VERSION already exists and releases are immutable — nothing to repair."
212+
exit 0
213+
fi
206214
PRERELEASE_FLAG=""
207215
case "$VERSION" in
208216
*-rc.*) PRERELEASE_FLAG="--prerelease" ;;
209217
esac
210-
if gh release view "v$VERSION" >/dev/null 2>&1; then
211-
gh release edit "v$VERSION" \
212-
--target "$GITHUB_SHA" \
213-
--title "v$VERSION"
214-
else
215-
gh release create "v$VERSION" \
216-
--target "$GITHUB_SHA" \
217-
--title "v$VERSION" \
218-
--generate-notes \
219-
$PRERELEASE_FLAG
218+
gh release create "v$VERSION" \
219+
--draft \
220+
--target "$GITHUB_SHA" \
221+
--title "v$VERSION" \
222+
--generate-notes \
223+
$PRERELEASE_FLAG \
224+
artifacts/tarballs/*.tgz
225+
# A draft's tag does not exist yet, so `gh release edit
226+
# <tag> --draft=false` cannot address it; publish through the
227+
# API by the draft's id.
228+
release_id=$(gh api "repos/$GITHUB_REPOSITORY/releases" \
229+
--jq ".[] | select(.draft and .tag_name == \"v$VERSION\") | .id" | head -1)
230+
if [ -z "$release_id" ]; then
231+
echo "Could not find the draft release for v$VERSION" >&2
232+
exit 1
220233
fi
221-
# The exact tarballs the smoke verified, attached to the
222-
# Release. --clobber keeps reruns idempotent.
223-
gh release upload "v$VERSION" artifacts/tarballs/*.tgz --clobber
234+
gh api -X PATCH "repos/$GITHUB_REPOSITORY/releases/$release_id" \
235+
-F draft=false >/dev/null
236+
echo "Published release v$VERSION with $(ls artifacts/tarballs/*.tgz | wc -l | tr -d ' ') asset(s)."

0 commit comments

Comments
 (0)