From d46bea43d3bf0d2807ee873d82cc3c6827184420 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Tue, 11 Aug 2026 21:47:04 +0100 Subject: [PATCH 1/7] stop deploy-staging from triggering on unsuccessful unit test runs --- .github/workflows/deploy-staging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index e708b71558..68b6c60d46 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -14,6 +14,7 @@ env: IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor-staging jobs: push_to_registry: + if: github.event.workflow_run.conclusion == 'success' environment: staging name: Push Docker image to Docker Hub runs-on: ubuntu-latest From 1dd911985c4ac074e38731a0c2dc6d91be23d73b Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Tue, 11 Aug 2026 21:49:51 +0100 Subject: [PATCH 2/7] update deploy to run after releases instead of on merges to release --- .github/workflows/deploy.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 08e8f4ffe5..51450c355b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,11 +1,8 @@ name: Deploy to production on: - workflow_run: - workflows: ["Test"] - branches: - - release + release: types: - - completed + - published env: PROJECT_ID: ${{ secrets.GKE_PROJECT }} GKE_CLUSTER: p5-gke-cluster @@ -21,7 +18,7 @@ jobs: - name: Check out the repo uses: actions/checkout@v3 with: - ref: release + ref: ${{ github.event.release.tag_name }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: From 56acb2ebb08a3c0824e6baa938493b6788ae95d0 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Wed, 12 Aug 2026 11:09:57 +0100 Subject: [PATCH 3/7] add release-reminder to create cron-job issue with link to Create a release workflow, every Tuesday NY 3:30pm --- .github/workflows/release-reminder.yml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/release-reminder.yml diff --git a/.github/workflows/release-reminder.yml b/.github/workflows/release-reminder.yml new file mode 100644 index 0000000000..8781667963 --- /dev/null +++ b/.github/workflows/release-reminder.yml @@ -0,0 +1,32 @@ +name: Weekly release reminder + +on: + # Tuesdays 15:30 UTC + schedule: + - cron: "30 15 * * 2" + workflow_dispatch: {} + +permissions: + issues: write + +jobs: + remind: + runs-on: ubuntu-latest + steps: + - name: Open release reminder issue + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: `Weekly release - ${new Date().toISOString().slice(0, 10)}`, + body: [ + "1. Decide on any remaining PRs to merge into `develop`", + "2. Review what's merged into `develop` since the last release.", + "3. Decide the version bump (patch/minor/major).", + "4. Run the [Create a release](../actions/workflows/release.yml) workflow with that version.", + "", + "No release needed this week? Just close this issue." + ].join("\n") + }); From 3e32881ba32a112325d44cd22265de892a9cf6e3 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Wed, 12 Aug 2026 11:25:51 +0100 Subject: [PATCH 4/7] add release workflow --- .github/workflows/release.yml | 95 +++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..9fef8cd7e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: Create a release + +on: + workflow_dispatch: + inputs: + newversion: + description: > + Version to release. Accepts an explicit semver (e.g. 2.22.0) or an + npm version keyword (patch, minor, major, prepatch, preminor, + premajor, prerelease). See https://docs.npmjs.com/cli/version + required: true + type: string + +permissions: + contents: write + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - name: Check out develop + uses: actions/checkout@v4 + with: + ref: develop + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18.20.x' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test:ci + + # future: deploy to staging (+stop deploying to staging upon merges to develop) + e2e test pointed at staging + + release: + needs: verify + runs-on: ubuntu-latest + # Requires a maintainer to approve in the Actions UI before this job runs. + # Configure required reviewers under Settings > Environments > release-approval. + environment: release-approval + steps: + - name: Check out develop + uses: actions/checkout@v4 + with: + ref: develop + + - name: Fetch release branch + run: git fetch origin release:release + + - name: Configure git identity + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create temporary release branch + run: git checkout -b "release-${{ inputs.newversion }}" + + - name: Bump version + id: bump + run: | + NEW_VERSION=$(npm version "${{ inputs.newversion }}" -m "v%s") + echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + + - name: Merge into release + run: | + git checkout release + git pull origin release + git merge --no-ff "release-${{ inputs.newversion }}" -m "Merge release-${{ inputs.newversion }} into release" + git push origin release + git push origin --tags + + - name: Merge back into develop + run: | + git checkout develop + git pull origin develop + git merge --no-ff "release-${{ inputs.newversion }}" -m "Merge release-${{ inputs.newversion }} into develop" + git push origin develop + + - name: Delete temporary release branch + run: git push origin --delete "release-${{ inputs.newversion }}" + + - name: Draft GitHub release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${{ steps.bump.outputs.version }}" \ + --target release \ + --title "${{ steps.bump.outputs.version }}" \ + --generate-notes \ + --draft From abc4454679f14752cd52a4e38badfae41107a831 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Wed, 12 Aug 2026 11:26:21 +0100 Subject: [PATCH 5/7] update release instructions with GHA steps --- contributor_docs/release.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/contributor_docs/release.md b/contributor_docs/release.md index 0ede9dab33..6dbad54c93 100644 --- a/contributor_docs/release.md +++ b/contributor_docs/release.md @@ -3,17 +3,31 @@ A guide for deploying a release to the production environment. ## Background + This project's release guide is based on: -* [git-flow](https://nvie.com/posts/a-successful-git-branching-model/) -* [Semantic Versioning (semver)](https://semver.org/) -* [npm-version](https://docs.npmjs.com/cli/version) -* [Let's stop saying Master/Slave](https://medium.com/@mikebroberts/let-s-stop-saying-master-slave-10f1d1bf34df) -## Steps +- [git-flow](https://nvie.com/posts/a-successful-git-branching-model/) +- [Semantic Versioning (semver)](https://semver.org/) +- [npm-version](https://docs.npmjs.com/cli/version) +- [Let's stop saying Master/Slave](https://medium.com/@mikebroberts/let-s-stop-saying-master-slave-10f1d1bf34df) + +## Steps for a standard release: + +### via GHA: + +1. An issue titled "Weekly release - DATE" will be created every Tuesday at 15:30 UTC. Go to the [Issues tab](https://github.com/processing/p5.js-web-editor/issues) and click the link in the description to the [Create a release](../.github/workflows/release.yml) GitHub Actions workflow. +2. Run the **Create a release** workflow via "Run workflow". +3. Enter the version to release: either an explicit semver (e.g. `2.22.0`) or an [npm version](https://docs.npmjs.com/cli/version) keyword (`patch`, `minor`, `major`, etc). +4. Wait for the workflow to run the `verify` job, which tests the checked out code in `develop`. If tests fail, the workflow will stop & record its result as a failure. Devs should fix any test failures, then attempt the [Create a release](../.github/workflows/release.yml) workflow again. +5. If the tests succeed, the workflow will wait on maintainer approval for the `draft-release` job. Go to [Staging](https://stagingeditor.p5js.org) and perform any manual checks. If all looks good, approve the `release` job. This does steps 5-12 below which results in merging the cut release into `release`; merging `release` into `develop`; and a new draft GitHub release with auto-generated notes & version & tags. +6. [Review the drafted release](https://github.com/processing/p5.js-web-editor/releases) and click **Publish release** when ready. This will then trigger the deployment to [Production](editor.p5js.org). + +### Manually: + 1. `$ git checkout develop` 2. `$ git pull origin develop` 3. `$ git checkout -b release-` -4. Do all of the release branch testing necessary. This could be as simple as running `npm test:ci`, or it could take user testing over a few days. +4. Do all of the release branch testing necessary. This could be as simple as running `npm test:ci`, or it could take user testing over a few days. 5. `$ npm version ` (see [npm-version](https://docs.npmjs.com/cli/version) for valid values of ). 6. `$ git checkout release` 7. `$ git merge --no-ff release-` @@ -23,12 +37,14 @@ This project's release guide is based on: 11. `$ git push origin develop` 12. [Draft a new release on Github](https://github.com/processing/p5.js-web-editor/releases/new). Choose the tag that is the release version you just created, and then title it `v`. Then click "Generate release notes". Publish the release and you are finished! -Travis CI will automatically deploy the release to production, as well as push a production tagged Docker image to DockerHub. - +GHA will automatically deploy the release to production, as well as push a production tagged Docker image to DockerHub. ## Steps for a Patch Release + Sometimes you might need to push a release for an isolated and small bug fix without what's currently been merged into the `develop` branch. The steps for pushing a Patch Release are similar to a standard Release, except you work with the `release` branch as opposed to `develop`. +This process is not yet automated by the Actions workflow above, so it's still done by hand. + 1. `$ git checkout release` 2. `$ git pull origin release` 3. `$ git checkout -b release-` (increment patch version) From 1abc4d9361bc61cd7b82f61cf749940cb1dcc9f3 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Tue, 18 Aug 2026 17:10:43 +0100 Subject: [PATCH 6/7] wrap if check --- .github/workflows/deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 68b6c60d46..508a69e0d6 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -14,7 +14,7 @@ env: IMAGE: ${{ secrets.DOCKER_USERNAME }}/p5.js-web-editor-staging jobs: push_to_registry: - if: github.event.workflow_run.conclusion == 'success' + if: ${{ github.event.workflow_run.conclusion == 'success' }} environment: staging name: Push Docker image to Docker Hub runs-on: ubuntu-latest From fa7d873df7375cd3aa87338b8c43e197a2b0e785 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Tue, 18 Aug 2026 17:11:46 +0100 Subject: [PATCH 7/7] addres feedback: push the cut release branch instead of deleting --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fef8cd7e6..182db29364 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - - name: Create temporary release branch + - name: Create cut release branch run: git checkout -b "release-${{ inputs.newversion }}" - name: Bump version @@ -81,8 +81,8 @@ jobs: git merge --no-ff "release-${{ inputs.newversion }}" -m "Merge release-${{ inputs.newversion }} into develop" git push origin develop - - name: Delete temporary release branch - run: git push origin --delete "release-${{ inputs.newversion }}" + - name: Push cut release branch + run: git push origin "release-${{ inputs.newversion }}" - name: Draft GitHub release env: