Skip to content

Commit 6ac2a57

Browse files
authored
Merge pull request #8603 from limzykenneth/dev-2.0
Continuous release with pkg.pr.new and esm.sh
2 parents 83415b7 + efc0bfd commit 6ac2a57

File tree

3 files changed

+645
-3
lines changed

3 files changed

+645
-3
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish approved pull requests and latest commit to pkg.pr.new
2+
on:
3+
pull_request:
4+
branches:
5+
- 'dev-2.0'
6+
push:
7+
branches:
8+
- 'dev-2.0'
9+
tags:
10+
- '!**'
11+
12+
permissions:
13+
pull-requests: write
14+
issues: write
15+
16+
jobs:
17+
publish:
18+
if: github.repository == 'processing/p5.js'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build library
31+
run: npm run build
32+
33+
- name: Publish library
34+
run: npx pkg-pr-new publish --no-template --json output.json --comment=off
35+
36+
- name: Include PR info in output file
37+
uses: actions/github-script@v8
38+
env:
39+
PR_NUMBER: ${{ github.event.pull_request.number }}
40+
with:
41+
script: |
42+
const fs = require('fs');
43+
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
44+
output.workflow = {
45+
pull_request: process.env.PR_NUMBER ? {
46+
number: process.env.PR_NUMBER
47+
} : null
48+
};
49+
fs.writeFileSync('output.json', JSON.stringify(output));
50+
51+
- name: Upload output data
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: output.zip
55+
path: output.json

0 commit comments

Comments
 (0)