Skip to content
Open
55 changes: 55 additions & 0 deletions .github/workflows/continuous-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish approved pull requests and latest commit to pkg.pr.new
on:
pull_request:
branches:
- 'dev-2.0'
push:
branches:
- 'dev-2.0'
tags:
- '!**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely minor: or keep RCs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RC will get published on NPM so it is available through jsdelivr already


permissions:
pull-requests: write
issues: write

jobs:
publish:
if: github.repository == 'processing/p5.js'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Build library
run: npm run build

- name: Publish library
run: npx pkg-pr-new publish --no-template --json output.json --comment=off
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also minor: pin pkg-pr-new version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg-pr-new is pin as a dev dependency in the repo and not through an action so should be fixed by package-lock.json


- name: Include PR info in output file
uses: actions/github-script@v8
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
with:
script: |
const fs = require('fs');
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
output.workflow = {
pull_request: process.env.PR_NUMBER ? {
number: process.env.PR_NUMBER
} : null
};
fs.writeFileSync('output.json', JSON.stringify(output));

- name: Upload output data
uses: actions/upload-artifact@v4
with:
name: output.zip
path: output.json
Loading
Loading