-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 2.01 KB
/
create-dev-release.yml
File metadata and controls
59 lines (50 loc) · 2.01 KB
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
name: "Create Dev Release"
on:
pull_request:
types: [labeled, synchronize]
jobs:
create-dev-release:
# Only run for the 'create-dev-release' label
if: |
(github.event.action == 'labeled' && github.event.label.name == 'create-dev-release') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'create-dev-release'))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: "Checkout PR code"
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: "Setup Node.js"
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: "Install pnpm"
uses: pnpm/action-setup@v4.0.0
- name: "Install dependencies"
run: pnpm i --frozen-lockfile --ignore-scripts
- name: "Build package"
run: pnpm run build
- name: "Publish temporary version with pkg.pr.new"
run: pnpx pkg-pr-new publish './packages/visual-editor' --template './starter'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: "Notify Starter Repo"
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.WEBSITE_REPO_PAT }}
repository: YextSolutions/pages-visual-editor-starter
event-type: dev-release-created
client-payload: >
{
"pr_number": "${{ github.event.pull_request.number }}",
"branch_name": "pr-${{ github.event.pull_request.number }}",
"pr_title": "${{ github.event.pull_request.title }}",
"pr_url": "${{ github.event.pull_request.html_url }}",
"author": "${{ github.event.pull_request.user.login }}",
"package_url": "https://pkg.pr.new/yext/visual-editor/@yext/visual-editor@${{ github.event.pull_request.number }}"
}