Skip to content

Commit 9cca596

Browse files
committed
Merge release/5.1.0 into trunk
2 parents 168b6d0 + d6eff58 commit 9cca596

File tree

112 files changed

+3586
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3586
-484
lines changed

.github/actions/generate-changelog/action.yml renamed to .github/actions/process-changelog/action.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Generate the changelog for WooCommerce Payments"
2-
description: "Generate the changelog from the version provided"
1+
name: "Process the changelog for WooCommerce Payments"
2+
description: "Generate or amend the changelog entries"
33

44
inputs:
55
release-version:
@@ -9,29 +9,41 @@ inputs:
99
description: "The release date (format: YYYY-MM-DD) for which the action should generate the changelog (default: unreleased)"
1010
required: false
1111
default: "unreleased"
12+
action-type:
13+
description: 'Whether this is to generate or amend the changelog entries (generate or amend)'
14+
required: false
15+
default: "generate"
1216

1317
outputs:
1418
changelog:
15-
description: "The escaped changelog content generated from the release version provided"
16-
value: ${{ steps.get_changelog.outputs.CHANGELOG }}
19+
description: "The escaped changelog content"
20+
value: ${{ steps.process_changelog.outputs.CHANGELOG }}
1721

1822
runs:
1923
using: composite
2024
steps:
21-
- name: "Generate changelog"
22-
id: get_changelog
25+
- name: "Process changelog"
26+
id: process_changelog
2327
shell: bash
2428
env:
25-
VERSION: ${{ inputs.release-version }}
29+
ACTION_TYPE: ${{ inputs.action-type }}
30+
RELEASE_VERSION: ${{ inputs.release-version }}
2631
RELEASE_DATE: ${{ inputs.release-date }}
2732
run: |
2833
# Install this dev package globally to gather changelog entries while not including it into the release package
2934
composer global require automattic/jetpack-changelogger:^3.0.7
3035
31-
# Gather changelog entries
32-
~/.composer/vendor/bin/changelogger write --use-version="$VERSION" --release-date="$RELEASE_DATE"
36+
if ${{ env.ACTION_TYPE == 'generate' }}; then
37+
CHANGELOG_FLAG=""
38+
echo "Generating the changelog entries." >> $GITHUB_STEP_SUMMARY
39+
else
40+
CHANGELOG_FLAG="--amend"
41+
echo "Amending the changelog entries." >> $GITHUB_STEP_SUMMARY
42+
fi
43+
44+
~/.composer/vendor/bin/changelogger write --use-version="$RELEASE_VERSION" --release-date="$RELEASE_DATE" $CHANGELOG_FLAG --no-interaction
3345
34-
echo "Picking up changelog for version '$VERSION'..."
46+
echo "Picking up changelog for version '$RELEASE_VERSION'..."
3547
CHANGELOG=$(awk '/^= / { if (p) { exit }; p=1; next } p && NF' changelog.txt)
3648
echo "$CHANGELOG"
3749

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
name: "Build zip file"
22

3-
# This action will run when a pull request targeting `trunk` is closed/merged or when it is triggered manually.
3+
# This action will run when it is triggered manually.
44
on:
5-
pull_request_target:
6-
branches:
7-
- 'trunk'
8-
types:
9-
- closed
105
workflow_dispatch:
116

127
jobs:
13-
# The job runs only if the workflow was triggered manually or if it was triggered by a PR targeting trunk which was merged
148
build-zip:
159
name: "Build the zip file"
16-
if: ${{ github.event_name != 'pull_request_target' || startsWith(github.head_ref, 'release/') && github.event.pull_request.merged == true }}
1710
runs-on: ubuntu-20.04
1811
steps:
1912
- name: "Checkout repository"
@@ -25,12 +18,17 @@ jobs:
2518
- name: "Build the plugin"
2619
id: build_plugin
2720
uses: ./.github/actions/build
21+
22+
- name: "Unzip the file (prevents double zip issue)"
23+
run: |
24+
echo ":information_source: Unzipping to a folder to prevent double-zip issue ([known limitation](https://github.com/actions/upload-artifact#zipped-artifact-downloads)). Increase in artifact size is expected since we're uploading the folder." >> $GITHUB_STEP_SUMMARY
25+
unzip ${{ steps.build_plugin.outputs.release-filename }} -d zipfile
2826
2927
- name: "Upload the zip file as an artifact"
3028
uses: actions/upload-artifact@v3
3129
env:
3230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3331
with:
3432
name: "woocommerce-payments"
35-
path: ${{ steps.build_plugin.outputs.release-filename }}
33+
path: zipfile
3634
retention-days: 7

.github/workflows/compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
pull_request
55

66
env:
7-
WC_L2_VERSION: '6.8.2'
8-
WP_L2_VERSION: '5.8'
7+
WC_L2_VERSION: '6.9.0'
8+
WP_L2_VERSION: '5.9'
99

1010
jobs:
1111
generate-matrix:

.github/workflows/create-pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
- name: "Generate the changelog"
4545
id: generate_changelog
46-
uses: ./.github/actions/generate-changelog
46+
uses: ./.github/actions/process-changelog
4747
with:
4848
release-version: ${{ steps.create_tag.outputs.trimmed-version }}
4949

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
2424
E2E_USE_LOCAL_SERVER: false
2525
E2E_RESULT_FILEPATH: 'tests/e2e/results.json'
26-
WC_L2_VERSION: '6.8.2'
26+
WC_L2_VERSION: '6.9.0'
2727

2828

2929
jobs:

.github/workflows/php-lint-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
env:
77
WP_VERSION: latest
8-
WC_L2_VERSION: '6.8.2' # the min supported version as per L-2 policy
8+
WC_L2_VERSION: '6.9.0' # the min supported version as per L-2 policy
99
GUTENBERG_VERSION: latest
1010

1111
jobs:

.github/workflows/platform-checkout-test-site-sync.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/post-release-updates.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ name: "Handle post-release steps"
33
# This action will run when it is triggered manually
44
on:
55
workflow_dispatch:
6-
inputs:
7-
allowMerge:
8-
description: 'Whether we allow merging trunk back into develop'
9-
required: false
10-
type: string
11-
default: "false"
126

137
defaults:
148
run:
@@ -81,7 +75,6 @@ jobs:
8175
merge-trunk-into-develop:
8276
name: "Merge trunk back into develop"
8377
needs: get-last-released-version
84-
if: ${{ inputs.allowMerge == 'true' }}
8578
runs-on: ubuntu-20.04
8679
env:
8780
RELEASE_VERSION: ${{ needs.get-last-released-version.outputs.releaseVersion }}
@@ -92,11 +85,12 @@ jobs:
9285
with:
9386
ref: 'trunk'
9487
fetch-depth: 0
88+
token: ${{ SECRETS.BOTWOO_TOKEN }}
9589

9690
- name: "Merge trunk back into develop"
9791
run: |
98-
git config user.name "${{ github.actor }}"
99-
git config user.email "${{ github.actor }}@users.noreply.github.com"
92+
git config user.name "botwoo"
93+
git config user.email "botwoo@users.noreply.github.com"
10094
git checkout develop && git pull
10195
git merge trunk --no-ff -m "Merge trunk v$RELEASE_VERSION into develop"
10296
git push
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "Release - Changelog"
2+
3+
# This action will run when it is triggered manually
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
release-version:
8+
description: "The release version for which the action should process the changelog (e.g. 4.5.0)"
9+
required: true
10+
type: string
11+
release-date:
12+
description: "The release date in human-readable format (default: 'today')."
13+
required: false
14+
default: "today"
15+
type: string
16+
action-type:
17+
description: "Whether this is to amend or generate the changelog entries (default: 'amend')."
18+
required: true
19+
default: "amend"
20+
type: choice
21+
options:
22+
- amend
23+
- generate
24+
25+
defaults:
26+
run:
27+
shell: bash
28+
29+
jobs:
30+
process-changelog:
31+
name: "Process the changelog"
32+
runs-on: ubuntu-20.04
33+
env:
34+
CHANGELOG_ACTION: ${{ inputs.action-type }}
35+
RELEASE_VERSION: ${{ inputs.release-version }}
36+
RELEASE_DATE: ${{ inputs.release-date }}
37+
steps:
38+
- name: "Checkout repository"
39+
uses: actions/checkout@v3
40+
41+
- name: "Format the release date"
42+
id: format_date
43+
run: |
44+
RELEASE_DATE=$( date "+%Y-%m-%d" -d "$RELEASE_DATE" ) # Release date formatted as YYYY-MM-DD
45+
echo "RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_OUTPUT
46+
47+
- name: "Process changelog"
48+
id: process_changelog
49+
uses: ./.github/actions/process-changelog
50+
with:
51+
release-version: ${{ env.RELEASE_VERSION }}
52+
release-date: ${{ steps.format_date.outputs.RELEASE_DATE }}
53+
action-type: ${{ env.CHANGELOG_ACTION }}
54+
55+
- name: "Update readme.txt"
56+
env:
57+
RELEASE_DATE: ${{ steps.format_date.outputs.RELEASE_DATE }}
58+
CHANGELOG: ${{ steps.process_changelog.outputs.changelog }}
59+
run: |
60+
if ${{ env.CHANGELOG_ACTION == 'amend' }}; then
61+
perl -i -p0e "s/= $RELEASE_VERSION.*?(\n){2}//s" readme.txt # Delete the existing changelog for the release version
62+
fi
63+
64+
sed -ri "s|(== Changelog ==)|\1\n\n= $RELEASE_VERSION - $RELEASE_DATE =\n$CHANGELOG|" readme.txt
65+
66+
- name: "Commit and push the changes"
67+
run: |
68+
git config user.name "${{ github.actor }}"
69+
git config user.email "${{ github.actor }}@users.noreply.github.com"
70+
if ${{ env.CHANGELOG_ACTION == 'amend' }}; then
71+
git commit -am "Amend changelog entries for release $RELEASE_VERSION"
72+
else
73+
git commit -am "Generate changelog entries for release $RELEASE_VERSION"
74+
fi
75+
git push

.github/workflows/release-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
required: true
1010
type: string
1111
releaseDateString:
12-
description: "The release date in human-readable format, which will be formatted for changelog.txt and readme.txt (default: 'next wednesday')."
12+
description: "The release date in human-readable format (default: 'next wednesday')."
1313
required: false
1414
default: "next wednesday"
1515
type: string
@@ -20,7 +20,7 @@ on:
2020
required: true
2121
type: string
2222
releaseDateString:
23-
description: "The release date in human-readable format, which will be formatted for changelog.txt and readme.txt (default: 'next wednesday')."
23+
description: "The release date in human-readable format (default: 'next wednesday')."
2424
required: false
2525
default: "next wednesday"
2626
type: string
@@ -61,7 +61,7 @@ jobs:
6161
6262
- name: "Generate the changelog"
6363
id: generate_changelog
64-
uses: ./.github/actions/generate-changelog
64+
uses: ./.github/actions/process-changelog
6565
with:
6666
release-version: ${{ steps.create_branch.outputs.trimmed-version }}
6767
release-date: ${{ steps.define_var.outputs.RELEASE_DATE }}

0 commit comments

Comments
 (0)