From 18d00a9ec31482b5e888f7d69e5bf0eec7591f10 Mon Sep 17 00:00:00 2001 From: Boshen Date: Sun, 10 May 2026 19:20:29 +0800 Subject: [PATCH] chore: gate pkg.pr.new publish on label only Drop the workflow_dispatch and ci/pkg-pr-new push triggers so the preview publish only runs when a PR is labeled with pkg.pr.new. Add MAINTENANCE.md documenting the label workflow and how to install a preview build. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/publish-to-pkg.pr.new.yml | 16 +++------------- MAINTENANCE.md | 13 +++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 MAINTENANCE.md diff --git a/.github/workflows/publish-to-pkg.pr.new.yml b/.github/workflows/publish-to-pkg.pr.new.yml index 46e23a7d80..b75317c9aa 100644 --- a/.github/workflows/publish-to-pkg.pr.new.yml +++ b/.github/workflows/publish-to-pkg.pr.new.yml @@ -5,10 +5,6 @@ name: Publish to pkg.pr.new permissions: {} on: - workflow_dispatch: - push: - branches: - - ci/pkg-pr-new pull_request: types: [labeled] @@ -20,9 +16,7 @@ jobs: prepare: if: >- github.repository == 'voidzero-dev/vite-plus' && - (github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'pkg.pr.new'))) + contains(github.event.pull_request.labels.*.name, 'pkg.pr.new') name: Compute snapshot version runs-on: ubuntu-latest permissions: @@ -45,9 +39,7 @@ jobs: name: Build bindings and binaries if: >- github.repository == 'voidzero-dev/vite-plus' && - (github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'pkg.pr.new'))) + contains(github.event.pull_request.labels.*.name, 'pkg.pr.new') needs: prepare permissions: contents: read @@ -59,9 +51,7 @@ jobs: publish: if: >- github.repository == 'voidzero-dev/vite-plus' && - (github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'pkg.pr.new'))) + contains(github.event.pull_request.labels.*.name, 'pkg.pr.new') name: Pkg Preview runs-on: ubuntu-latest needs: diff --git a/MAINTENANCE.md b/MAINTENANCE.md new file mode 100644 index 0000000000..195c13c8c6 --- /dev/null +++ b/MAINTENANCE.md @@ -0,0 +1,13 @@ +# Maintenance + +## Publishing Preview Packages + +Publish to https://pkg.pr.new/~/voidzero-dev/vite-plus + +Add the `pkg.pr.new` label to the PR. + +Use the commit sha, e.g.: + +```sh +pnpm add https://pkg.pr.new/voidzero-dev/vite-plus@sha +```