-
-
Notifications
You must be signed in to change notification settings - Fork 518
60 lines (49 loc) · 1.46 KB
/
release-preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: release-preview
on:
pull_request_review:
types: [submitted]
workflow_dispatch:
jobs:
check:
# Trigger the permissions check whenever someone approves a pull request.
# They must have the write permissions to the repo in order to
# trigger preview package publishing.
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
outputs:
has-permissions: ${{ steps.checkPermissions.outputs.require-result }}
steps:
- name: Check permissions
id: checkPermissions
uses: actions-cool/check-user-permission@v2
with:
require: 'write'
publish:
# The approving user must pass the permissions check
# to trigger the preview publish.
needs: check
if: needs.check.outputs.has-permissions == 'true'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.6
- name: Install dependencies
run: pnpm install
- name: Install Playwright browsers
run: pnpm exec playwright install
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
- name: Tests
run: pnpm test
- name: Publish preview
run: pnpm dlx [email protected] publish --compact --pnpm --comment=update