From 9cc0c19528ee40960992c3c7c304593461dc8e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20P=C3=A9rez=20Pellicer?= <5908855+puntope@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:40:31 +0200 Subject: [PATCH 1/6] Prevent unstable releases --- .../actions/get-plugin-releases/src/get-plugin-releases.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js index a846eece..a198a7cb 100644 --- a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js +++ b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js @@ -53,12 +53,14 @@ function parsePluginVersions( releases = {} ) { const output = []; if ( slug !== 'wordpress' ) { + const latest = releases.version; const versions = Object.keys( releases.versions ) .filter( ( version ) => version !== 'trunk' && version !== 'other' && - ! version.includes( 'beta' ) + ! version.includes( 'beta' ) && + semverCompare( latest, version ) <= 0 ) .sort( semverCompare ); From a9ddff799f70725c76fa921fd509fd239b4ab00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20P=C3=A9rez=20Pellicer?= <5908855+puntope@users.noreply.github.com> Date: Sat, 13 Apr 2024 10:49:40 +0700 Subject: [PATCH 2/6] Support RC and Prevent unstable releases --- .../actions/get-plugin-releases/src/get-plugin-releases.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js index a198a7cb..82114e0e 100644 --- a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js +++ b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js @@ -60,7 +60,7 @@ function parsePluginVersions( releases = {} ) { version !== 'trunk' && version !== 'other' && ! version.includes( 'beta' ) && - semverCompare( latest, version ) <= 0 + ( includeRC || semverCompare( latest, version ) <= 0) ) .sort( semverCompare ); From ce5e87d14e14771e74f1c8f2c907600faa3c3402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20P=C3=A9rez=20Pellicer?= <5908855+puntope@users.noreply.github.com> Date: Sat, 13 Apr 2024 11:08:00 +0700 Subject: [PATCH 3/6] JS LINT --- .../actions/get-plugin-releases/src/get-plugin-releases.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js index 82114e0e..512443ff 100644 --- a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js +++ b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js @@ -60,7 +60,7 @@ function parsePluginVersions( releases = {} ) { version !== 'trunk' && version !== 'other' && ! version.includes( 'beta' ) && - ( includeRC || semverCompare( latest, version ) <= 0) + ( includeRC || semverCompare( latest, version ) <= 0 ) ) .sort( semverCompare ); From 8db7d34555ee882d08da668c96a2b5f1336e580a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20P=C3=A9rez=20Pellicer?= <5908855+puntope@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:01:36 +0800 Subject: [PATCH 4/6] Fix issue with includeRC --- .../actions/get-plugin-releases/src/get-plugin-releases.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js index 512443ff..7f99518b 100644 --- a/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js +++ b/packages/github-actions/actions/get-plugin-releases/src/get-plugin-releases.js @@ -60,7 +60,7 @@ function parsePluginVersions( releases = {} ) { version !== 'trunk' && version !== 'other' && ! version.includes( 'beta' ) && - ( includeRC || semverCompare( latest, version ) <= 0 ) + ( isRC( version ) || semverCompare( latest, version ) <= 0 ) ) .sort( semverCompare ); From ac1f4f25195381f651f10cbb2906f562cc452438 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 02:38:33 +0000 Subject: [PATCH 5/6] Update changelog and package version for the actions-v1.11.2 release of GitHub actions. --- packages/github-actions/CHANGELOG.md | 5 +++++ packages/github-actions/package-lock.json | 2 +- packages/github-actions/package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/github-actions/CHANGELOG.md b/packages/github-actions/CHANGELOG.md index ddcd08aa..d70a6d74 100644 --- a/packages/github-actions/CHANGELOG.md +++ b/packages/github-actions/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2024-04-25 (1.11.2) +### Tweaked 🔧 +* Add PHP linter and PHP linting in GitHub Actions. (https://github.com/woocommerce/grow/pull/109) +* Get Plugin Releases - Prevent unstable releases. (https://github.com/woocommerce/grow/pull/102) + ## 2024-02-06 (1.11.1) ### Bug Fixes 🐛 * Rename `add/qit-workflows-test-build` to `actions-v1` branch. (https://github.com/woocommerce/grow/pull/96) diff --git a/packages/github-actions/package-lock.json b/packages/github-actions/package-lock.json index c9fb7a20..03197e92 100644 --- a/packages/github-actions/package-lock.json +++ b/packages/github-actions/package-lock.json @@ -1,6 +1,6 @@ { "name": "woocommerce-grow-github-actions", - "version": "1.11.1", + "version": "1.11.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/github-actions/package.json b/packages/github-actions/package.json index 6ccc2035..89631a66 100644 --- a/packages/github-actions/package.json +++ b/packages/github-actions/package.json @@ -1,6 +1,6 @@ { "name": "woocommerce-grow-github-actions", - "version": "1.11.1", + "version": "1.11.2", "description": "GitHub JavaScript actions for a WooCommerce plugin repo by Grow Team.", "type": "module", "scripts": { From 644585e5c746a6c0cc7d710618763c119a786954 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Fri, 26 Apr 2024 18:24:48 +0800 Subject: [PATCH 6/6] Adjust the v1 of the `github-actions` package to be deprecated. --- .../github-actions-create-pr-for-release.mjs | 2 +- packages/github-actions/README.md | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/scripts/github-actions-create-pr-for-release.mjs b/.github/scripts/github-actions-create-pr-for-release.mjs index 0e690f97..6a1c7f43 100644 --- a/.github/scripts/github-actions-create-pr-for-release.mjs +++ b/.github/scripts/github-actions-create-pr-for-release.mjs @@ -20,7 +20,7 @@ ${ content }`; await github.rest.pulls.create( { ...context.repo, - base: 'trunk', + base: 'source/actions-v1', head: refName, title, body, diff --git a/packages/github-actions/README.md b/packages/github-actions/README.md index 5fd0a791..770139d2 100644 --- a/packages/github-actions/README.md +++ b/packages/github-actions/README.md @@ -1,11 +1,13 @@ # Custom GitHub actions -[![GitHub Actions - Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml/badge.svg)](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml) +[![GitHub Actions - Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml/badge.svg?branch=source%2Factions-v1)](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml) Custom GitHub actions that help to composite GitHub workflows across the repos maintained by the Grow Team. ## Actions list +:warning: v1 actions are deprecated as they are mainly based on Node.js <= v16. + - [`automerge-released-trunk`](actions/automerge-released-trunk) - Merge `trunk` to `develop` after an extension release - [`branch-label`](actions/branch-label) - Set PR labels according to the branch name - [`coverage-report`](actions/coverage-report) - Add a clover coverage report as a PR comment @@ -102,7 +104,7 @@ The release build will be committed to a standalone point in the git tree via th %%{ init: { "gitGraph": { - "mainBranchName": "trunk", + "mainBranchName": "source/actions-v1", "mainBranchOrder": 2 }, "themeVariables": { @@ -126,17 +128,17 @@ The release build will be committed to a standalone point in the git tree via th gitGraph commit commit - branch add/action-feature order: 3 + branch fix/action-bug order: 3 commit commit - checkout trunk - merge add/action-feature + checkout source/actions-v1 + merge fix/action-bug branch release/actions order: 1 commit id: "Changelog" commit id: "Bump version" branch tmp/release-build order: 0 commit id: "Release build" type: HIGHLIGHT tag: "actions-v1.2.3" - checkout trunk + checkout source/actions-v1 merge release/actions ``` @@ -145,16 +147,16 @@ gitGraph ### Official release process -1. :technologist: Create the specific branch `release/actions` onto the target revision on `trunk` branch. +1. :technologist: Create the specific branch `release/actions` onto the target revision on `source/actions-v1` branch. 1. :octocat: When the branch `release/actions` is created, will continue to commit the release content to `release/actions` branch. - Workflow [GitHub Actions - Prepare New Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-prepare-release.yml) - Prepend changelog to [CHANGELOG.md](CHANGELOG.md). - Update versions to [package.json](package.json) and [package-lock.json](package-lock.json). - - Creates a release PR from `release/actions` branch with `trunk` as the base branch. -1. :technologist: Check if the new changelog content and updated version are correct. - - For a patch version like fixing bugs, increases the Z number. For example, `actions-v1.4.8`. - - For a minor version like adding new features, increases the Y number and reset the Z to 0. For example, `actions-v1.5.0`. - - For a major version like having incompatible changes, increases the X number and reset the Y and Z to 0. For example, `actions-v2.0.0`. + - Creates a release PR from `release/actions` branch with `source/actions-v1` as the base branch. +1. :technologist: Check if the new changelog content and updated version are correct. Let's assume the current version is `actions-v1.4.7`. + - :warning: **Upgrading the major version number is incorrect. Please stop the publishing process!** + - For a patch version like fixing bugs, increases the patch number. For example, `actions-v1.4.8`. + - For a minor version like adding new features, increases the minor number and reset the patch number to 0. For example, `actions-v1.5.0`. - If something needs to be revised, append the changes in the release PR. 1. :technologist: If it's all good, approve the release PR to proceed with the next workflow. 1. :octocat: Once the release PR is approved, a workflow will create a new release with a new version tag. @@ -163,7 +165,6 @@ gitGraph - Workflow [GitHub Actions - Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml) - When the new release version is `actions-v1.4.8`, it should update the references of `actions-v1` and `actions-v1.4` onto `actions-v1.4.8`. - When the new release version is `actions-v1.5.0`, it should update the reference of `actions-v1` and create `actions-v1.5` tag onto `actions-v1.5.0`. - - When the new release version is `actions-v2.0.0`, it should create `actions-v2` and `actions-v2.0` tags onto `actions-v2.0.0`. 1. :technologist: Check if both release workflows are run successfully. 1. :technologist: Merge the release PR.