Skip to content

Commit 24befe8

Browse files
authored
chore: pkg.pr.new preview with label and comment (#18211)
1 parent b9b925e commit 24befe8

File tree

2 files changed

+44
-71
lines changed

2 files changed

+44
-71
lines changed

.github/workflows/preview-release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Preview release
2+
3+
env:
4+
# install playwright binary manually (because pnpm only runs install script once)
5+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
6+
7+
permissions:
8+
pull-requests: write
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
pull_request:
15+
types: [labeled]
16+
17+
jobs:
18+
preview:
19+
if: >
20+
github.repository == 'vitejs/vite' &&
21+
(github.event_name == 'push' ||
22+
(github.event.issue.pull_request && contains(github.event.pull_request.labels.*.name, 'trigger: preview')))
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Install pnpm
29+
uses: pnpm/[email protected]
30+
31+
- name: Install dependencies
32+
run: pnpm install
33+
34+
- name: Build
35+
working-directory: ./packages/vite
36+
run: pnpm build
37+
38+
- run: pnpm dlx [email protected] publish --compact --pnpm ./packages/vite
39+
40+
- if: github.event_name != 'push'
41+
run: |
42+
gh issue edit ${{ github.event.issue.number }} --remove-label "trigger: preview" --repo ${{ github.repository }}
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-commit.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)