Skip to content

Commit c823a32

Browse files
committed
ci: stop publishing preview builds to pkg.pr.new
Nothing in the PR-build install path uses pkg.pr.new anymore: install.sh, vp migrate, and the Docker preview all resolve commit builds through the registry bridge, and the bridge action packs local directories. Drop the pkg-pr-new publish step and update the comments and sticky-comment wording accordingly. The pkg.pr.new label, this workflow's file name, and the rust cache-key keep their names: the label for muscle memory, the file name to preserve Actions run history, the cache-key to keep warm caches.
1 parent bd90647 commit c823a32

1 file changed

Lines changed: 36 additions & 40 deletions

File tree

.github/workflows/publish-to-pkg.pr.new.yml

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
name: Publish to pkg.pr.new
1+
name: Publish preview build
22

3-
# https://pkg.pr.new/~/voidzero-dev/vite-plus
3+
# Publishes a labeled PR's commit build to the registry bridge
4+
# (https://github.com/voidzero-dev/pkg-pr-registry-bridge), which serves it as
5+
# the npm version 0.0.0-commit.<sha>. Registered builds:
6+
# https://registry-bridge.viteplus.dev/-/refs
7+
# The `pkg.pr.new` label name predates the bridge and is kept for muscle
8+
# memory, as is this workflow's file name (renaming it would sever the Actions
9+
# run history).
410

511
permissions: {}
612

@@ -56,12 +62,12 @@ jobs:
5662
- prepare
5763
- build-rust
5864
permissions:
59-
# pkg-pr-new comments on PRs and posts run statuses with this token.
6065
contents: read
61-
pull-requests: write
6266
# The "Comment bridge version" step creates/updates a sticky comment via
63-
# github.rest.issues.createComment/updateComment; creating an issue comment
64-
# is gated on issues:write (the create path runs on PRs without one yet).
67+
# github.rest.issues.createComment/updateComment; comment writes on PRs
68+
# are gated on pull-requests:write, and creating an issue comment is
69+
# gated on issues:write (the create path runs on PRs without one yet).
70+
pull-requests: write
6571
issues: write
6672
env:
6773
VERSION: ${{ needs.prepare.outputs.version }}
@@ -127,43 +133,32 @@ jobs:
127133
pattern: vite-global-cli-*
128134

129135
# Stops short of `npm publish` and leaves packages/cli/{npm,cli-npm}/*
130-
# on disk for pkg-pr-new to upload.
136+
# on disk for the bridge action to pack.
131137
- name: Prepare native addon and CLI binary packages
132138
run: node ./packages/cli/publish-native-addons.ts --mode pkg-pr-new
133139

134-
- name: Publish to pkg.pr.new
135-
run: |
136-
pnpm dlx pkg-pr-new publish --compact --pnpm \
137-
'./packages/cli/npm/*' \
138-
'./packages/cli/cli-npm/*' \
139-
'./packages/cli' \
140-
'./packages/core' \
141-
'./packages/prompts'
142-
143-
# Publish this commit build to the pkg.pr.new registry bridge so it can be
144-
# installed as the npm version 0.0.0-commit.<sha>
145-
# (https://github.com/voidzero-dev/pkg-pr-registry-bridge). The bridge action
146-
# packs the locally built package directories prepared above (the two
147-
# preview packages and every platform binary), re-packs them under the
148-
# commit version with matching integrity, uploads them to the bridge, and
149-
# registers the ref. It packs from disk with `pnpm pack`, so it no longer
150-
# downloads from pkg.pr.new and is independent of the publish step above
151-
# (it just needs the workspace installed, which it is). This build publishes
152-
# under the PR head commit, so pass that SHA (not the merge commit
153-
# github.sha). Restricted to same-repo PRs because fork PRs do not receive
154-
# the admin token secret. A bridge failure fails the job: install.sh and
155-
# the Docker preview install PR builds through the bridge, so a silently
156-
# missing ref would only surface later as a broken install.
140+
# Publish this commit build to the registry bridge so it can be installed
141+
# as the npm version 0.0.0-commit.<sha>
142+
# (https://github.com/voidzero-dev/pkg-pr-registry-bridge). The bridge
143+
# action packs the locally built package directories prepared above (the
144+
# two preview packages and every platform binary) with `pnpm pack`,
145+
# re-packs them under the commit version with matching integrity, uploads
146+
# them to the bridge, and registers the ref. This build publishes under
147+
# the PR head commit, so pass that SHA (not the merge commit github.sha).
148+
# Restricted to same-repo PRs because fork PRs do not receive the admin
149+
# token secret. A bridge failure fails the job: install.sh and the Docker
150+
# preview install PR builds through the bridge, so a silently missing ref
151+
# would only surface later as a broken install.
157152
- name: Register commit build with the registry bridge
158153
id: bridge
159154
if: github.event.pull_request.head.repo.full_name == github.repository
160155
uses: voidzero-dev/pkg-pr-registry-bridge@711e22a2e1ae55d809fc5fab514c1180a41ac91e # main
161156
with:
162157
sha: ${{ github.event.pull_request.head.sha }}
163158
admin-token: ${{ secrets.PKG_PR_BRIDGE_ADMIN_TOKEN }}
164-
# The locally built directories to pack and publish, matching the
165-
# pkg-pr-new publish list above so the two stay in sync. (This is also
166-
# the action's default, passed explicitly for review parity.)
159+
# The locally built directories to pack and publish. (This is also
160+
# the action's default, passed explicitly so the published set is
161+
# reviewable here.)
167162
packages: |
168163
packages/cli/npm/*
169164
packages/cli/cli-npm/*
@@ -200,7 +195,7 @@ jobs:
200195
'',
201196
`### Registry bridge build (\`${shortSha}\`)`,
202197
'',
203-
'This commit is published to pkg.pr.new and registered with the [registry bridge](https://github.com/voidzero-dev/pkg-pr-registry-bridge), which serves these as ordinary npm versions (every other package proxies to npmjs):',
198+
'This commit build is published to the [registry bridge](https://github.com/voidzero-dev/pkg-pr-registry-bridge), which serves these as ordinary npm versions (every other package proxies to npmjs):',
204199
'',
205200
'| Package | Version |',
206201
'| --- | --- |',
@@ -264,9 +259,9 @@ jobs:
264259
});
265260
}
266261
267-
# Build and push a preview Docker image from the pkg.pr.new build so the image
268-
# can be verified before a real release. Tagged `pr-<number>`; never `latest`.
269-
# See docker/Dockerfile and docs/guide/docker.md.
262+
# Build and push a preview Docker image from the registry bridge build so the
263+
# image can be verified before a real release. Tagged `pr-<number>`; never
264+
# `latest`. See docker/Dockerfile and docs/guide/docker.md.
270265
publish-docker-preview:
271266
if: >-
272267
github.repository == 'voidzero-dev/vite-plus' &&
@@ -292,8 +287,9 @@ jobs:
292287
username: ${{ github.actor }}
293288
password: ${{ secrets.GITHUB_TOKEN }}
294289

295-
# Builds from the pkg.pr.new packages for this PR (VP_PR_VERSION). The
296-
# platform packages must exist first, hence `needs: publish`.
290+
# Builds from this PR's registry bridge build (VP_PR_VERSION resolves it
291+
# through the bridge). The bridge must have the commit build first, hence
292+
# `needs: publish`.
297293
# amd64-only: this throwaway preview avoids the slow arm64 QEMU leg; arm64
298294
# is covered by the release build and the test-install-sh-arm64 job.
299295
- name: Build and push preview image
@@ -358,7 +354,7 @@ jobs:
358354
marker,
359355
'## 🐳 Docker preview image',
360356
'',
361-
"Built from this PR's pkg.pr.new build:",
357+
"Built from this PR's registry bridge build:",
362358
'',
363359
'| Image | Compressed size |',
364360
'| --- | --- |',

0 commit comments

Comments
 (0)