Skip to content

Commit 396c5a9

Browse files
authored
chore: Add pkg.pr.new to preview PRs outside of NPM (#625)
* chore: Add pkg.pr.new to preview PRs outside of NPM * chore: Try and enable it on maintainer commits * chore: Build package before preview publishing * chore: Reduce workflow name verbosity * chore: Set the version to preview with Git SHA * chore: Fix Git SHA to use head of PR rather than merge To be consistent with pkg.pr.new's versioning.
1 parent d2c836a commit 396c5a9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/pkg.pr.new.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR Preview
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
pull_request_review:
6+
types: [submitted]
7+
8+
jobs:
9+
deploy-preview:
10+
name: Deploy to pkg.pr.new
11+
if: github.event.review.state == 'APPROVED' || contains(github.event.pull_request.author_association, 'MEMBER')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
15+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
16+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
17+
with:
18+
node-version-file: .node-version
19+
cache: pnpm
20+
- name: Install dependencies
21+
run: pnpm install
22+
- name: Build package
23+
run: pnpm build --filter nuqs
24+
- name: Set package version
25+
run: pnpm pkg set version=0.0.0-preview.${{ github.event.pull_request.head.sha }}
26+
working-directory: packages/nuqs
27+
- name: Publish to pkg.pr.new
28+
run: pnpx pkg-pr-new publish --compact './packages/nuqs'

0 commit comments

Comments
 (0)