Skip to content

Commit e4e047f

Browse files
committed
Update other workflows to handle prereleases
1 parent a4894fc commit e4e047f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/release-build-zip-file.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ jobs:
249249
env:
250250
GH_TOKEN: ${{ github.token }}
251251
GH_REPO: ${{ github.repository }}
252-
IS_PRERELEASE: ${{ contains(steps.get_version.outputs.version, '-rc') }}
252+
IS_PRERELEASE: ${{ contains( steps.get_version.outputs.version, '-dev' ) || contains( steps.get_version.outputs.version, '-beta' ) || contains( steps.get_version.outputs.version, '-rc' ) }}
253253
run: |
254254
FLAGS=""
255255
if [ "$IS_PRERELEASE" = "true" ]; then

.github/workflows/release-commits-and-contributors.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55
version:
66
type: string
77
required: true
8-
description: 'The release version (in X.Y or X.Y.Z-rc.N formats) to generate the release summary for.'
8+
description: 'The release version (in X.Y or X.Y.Z-beta.N formats) to generate the release summary for.'
99
workflow_call:
1010
inputs:
1111
version:
1212
type: string
1313
required: true
14-
description: 'The release version (in X.Y or X.Y.Z-rc.N formats) to generate the release summary for.'
14+
description: 'The release version (in X.Y or X.Y.Z-beta.N formats) to generate the release summary for.'
1515

1616
jobs:
1717
extract-versions:
@@ -36,9 +36,9 @@ jobs:
3636
const currentVersion = '${{ inputs.version }}';
3737
console.log(`Current version from input: ${currentVersion}`);
3838
39-
const versionMatch = currentVersion.match(/^(\d+)\.(\d+)(?:\.\d+)?(?:-(rc)\.(\d+))?$/);
39+
const versionMatch = currentVersion.match(/^(\d+)\.(\d+)(?:\.\d+)?(?:-(beta)\.(\d+))?$/);
4040
if (!versionMatch) {
41-
core.setFailed(`Version format must be 'x.y' or 'x.y.z-rc.N'. Provided: ${currentVersion}`);
41+
core.setFailed(`Version format must be 'x.y' or 'x.y.z-beta.N'. Provided: ${currentVersion}`);
4242
process.exit(1);
4343
}
4444

.github/workflows/release-new-release-published.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# Jobs to run after a pre-release is published (triggered by the "prereleased" GH event).
1212
generate-release-commits-and-contributors:
1313
name: 'Call release commits and contributors workflow'
14-
if: ${{ github.event.action == 'prereleased' }}
14+
if: ${{ ( github.event.action == 'prereleased' || ( github.event.action == 'published' && github.event.release.prerelease ) ) && contains( inputs.release_tag_name, '-beta' ) }}
1515
uses: woocommerce/woocommerce/.github/workflows/release-commits-and-contributors.yml@trunk
1616
with:
1717
version: ${{ inputs.release_tag_name }}
@@ -21,7 +21,7 @@ jobs:
2121
notify-release-published:
2222
name: 'Notify in Slack when a new (pre)release is published'
2323
runs-on: ${{ ( github.repository == 'woocommerce/woocommerce' && 'blacksmith-2vcpu-ubuntu-2404' ) || 'ubuntu-latest' }}
24-
if: ${{ github.event.action == 'published' }}
24+
if: ${{ github.event.action == 'published' && ! ( contains( inputs.release_tag_name, '-dev' ) || contains( inputs.release_tag_name, '-rc' ) ) }}
2525
steps:
2626
- name: 'Notify to release channel'
2727
uses: archive/github-actions-slack@a62d71a4ea93e68cbdc37581166b0298bea512e9 # v 2.10.0
@@ -36,7 +36,7 @@ jobs:
3636
update-global-changelog:
3737
name: 'Update changelog.txt after any stable release'
3838
runs-on: ${{ ( github.repository == 'woocommerce/woocommerce' && 'blacksmith-2vcpu-ubuntu-2404' ) || 'ubuntu-latest' }}
39-
if: ${{ github.event.action == 'published' && ! contains( inputs.release_tag_name, '-rc' ) }}
39+
if: ${{ github.event.action == 'published' && ! ( contains( inputs.release_tag_name, '-dev' ) || contains( inputs.release_tag_name, '-beta' ) || contains( inputs.release_tag_name, '-rc' ) ) }}
4040
steps:
4141
- name: 'Fetch release readme.txt'
4242
env:

0 commit comments

Comments
 (0)