Skip to content

Commit 56d5e8d

Browse files
committed
Merge release/6.1.0 into trunk
2 parents cc6d2f4 + 0871f91 commit 56d5e8d

File tree

202 files changed

+8036
-2164
lines changed

Some content is hidden

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

202 files changed

+8036
-2164
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
2+
3+
# Each line is a file pattern followed by one or more owners.
4+
5+
# Harmony owns any files in the .github directory at the root of the repository and any of its subdirectories.
6+
/.github/ @Automattic/harmony
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Commit and push as the github-actions bot"
2+
description: "Commit and push as the github-actions bot"
3+
4+
inputs:
5+
release-version:
6+
description: "The release version to be used in the commit message"
7+
required: true
8+
branch:
9+
description: "The branch where the commit will be pushed"
10+
required: true
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: "Commit and push changes"
16+
id: build_plugin
17+
shell: bash
18+
env:
19+
RELEASE_VERSION: ${{ inputs.release-version }}
20+
BRANCH_NAME: ${{ inputs.branch }}
21+
run: |
22+
git config user.name "github-actions[bot]"
23+
# We could consider fetching the bot's ID through an API call to be future-proof. Hardcoded for now.
24+
# See https://github.com/Automattic/woocommerce-payments/pull/5200#discussion_r1034560144
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
git commit -am "Update version and add changelog entries for release $RELEASE_VERSION"
27+
git push --set-upstream origin $BRANCH_NAME

.github/actions/process-changelog/action.yml

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,77 @@ outputs:
2222
runs:
2323
using: composite
2424
steps:
25-
- name: "Process changelog for changelog.txt"
26-
id: process_changelog
25+
- name: "Verify the action type"
26+
id: verify_action_type
27+
if: ${{ inputs.action-type == 'generate' }}
2728
shell: bash
2829
env:
29-
ACTION_TYPE: ${{ inputs.action-type }}
3030
RELEASE_VERSION: ${{ inputs.release-version }}
3131
RELEASE_DATE: ${{ inputs.release-date }}
32+
ACTION_TYPE: ${{ inputs.action-type }}
3233
run: |
33-
# Install this dev package globally to gather changelog entries while not including it into the release package
34-
composer global require automattic/jetpack-changelogger:^3.0.7
34+
FINAL_RELEASE_VERSION=$(echo "$RELEASE_VERSION" | grep -Po '\d.\d.\d(.*?)') # Keep only x.y.z from x.y.z(-test-n)
35+
CURRENT_RELEASE_VERSION=$(jq '.version' package.json -r)
3536
36-
if ${{ env.ACTION_TYPE == 'generate' }}; then
37-
CHANGELOG_FLAG=""
38-
echo "Generating the changelog entries." >> $GITHUB_STEP_SUMMARY
37+
# If the changelog directory is empty (except .gitkeep) and the final release version is already defined in package.json, we need to switch to amend
38+
# This use case is mainly for the last test package created from the release branch, to avoid an empty changelog
39+
if [ "$(ls -A changelog | wc -l)" -eq 1 ] && [[ "$FINAL_RELEASE_VERSION" == "$CURRENT_RELEASE_VERSION" ]]; then
40+
echo "ACTION_TYPE=amend-version" >> $GITHUB_OUTPUT
41+
echo "CURRENT_VERSION=$CURRENT_RELEASE_VERSION" >> $GITHUB_OUTPUT
3942
else
40-
CHANGELOG_FLAG="--amend"
41-
echo "Amending the changelog entries." >> $GITHUB_STEP_SUMMARY
43+
echo "ACTION_TYPE=$ACTION_TYPE" >> $GITHUB_OUTPUT
4244
fi
45+
46+
- name: "Process changelog for changelog.txt"
47+
id: process_changelog
48+
shell: bash
49+
env:
50+
ACTION_TYPE: ${{ steps.verify_action_type.outputs.ACTION_TYPE }}
51+
CURRENT_VERSION: ${{ steps.verify_action_type.outputs.CURRENT_VERSION }}
52+
RELEASE_VERSION: ${{ inputs.release-version }}
53+
RELEASE_DATE: ${{ inputs.release-date }}
54+
run: |
55+
if ${{ env.ACTION_TYPE == 'amend-version' }}; then
56+
sed -i "s/^= $CURRENT_VERSION - .* =$/= $RELEASE_VERSION - $RELEASE_DATE =/" changelog.txt
57+
else
58+
# Install this dev package globally to gather changelog entries while not including it into the release package
59+
composer global require automattic/jetpack-changelogger:^3.0.7
4360
44-
~/.composer/vendor/bin/changelogger write --use-version="$RELEASE_VERSION" --release-date="$RELEASE_DATE" $CHANGELOG_FLAG --no-interaction --yes
61+
if ${{ env.ACTION_TYPE == 'generate' }}; then
62+
CHANGELOG_FLAG=""
63+
echo "Generating the changelog entries." >> $GITHUB_STEP_SUMMARY
64+
else
65+
CHANGELOG_FLAG="--amend"
66+
echo "Amending the changelog entries." >> $GITHUB_STEP_SUMMARY
67+
fi
68+
69+
~/.composer/vendor/bin/changelogger write --use-version="$RELEASE_VERSION" --release-date="$RELEASE_DATE" $CHANGELOG_FLAG --no-interaction --yes
70+
fi
4571
46-
echo "Picking up changelog for version '$RELEASE_VERSION'..."
4772
CHANGELOG=$(awk '/^= / { if (p) { exit }; p=1; next } p && NF' changelog.txt)
48-
echo "$CHANGELOG"
4973
5074
# Escape backslash, new line and ampersand characters. The order is important.
5175
CHANGELOG=${CHANGELOG//\\/\\\\}
5276
CHANGELOG=${CHANGELOG//$'\n'/\\n}
5377
CHANGELOG=${CHANGELOG//&/\\&}
78+
5479
echo "CHANGELOG=$CHANGELOG" >> $GITHUB_OUTPUT
5580
5681
- name: "Process changelog for readme.txt"
5782
shell: bash
5883
env:
59-
ACTION_TYPE: ${{ inputs.action-type }}
84+
ACTION_TYPE: ${{ steps.verify_action_type.outputs.ACTION_TYPE }}
85+
CURRENT_VERSION: ${{ steps.verify_action_type.outputs.CURRENT_VERSION }}
6086
RELEASE_VERSION: ${{ inputs.release-version }}
6187
RELEASE_DATE: ${{ inputs.release-date }}
6288
CHANGELOG: ${{ steps.process_changelog.outputs.CHANGELOG }}
6389
run: |
64-
if ${{ env.ACTION_TYPE == 'amend' }}; then
65-
perl -i -p0e "s/= $RELEASE_VERSION.*?(\n){2}//s" readme.txt # Delete the existing changelog for the release version first
66-
fi
90+
if ${{ env.ACTION_TYPE == 'amend-version' }}; then
91+
sed -i "s/^= $CURRENT_VERSION - .* =$/= $RELEASE_VERSION - $RELEASE_DATE =/" readme.txt
92+
else
93+
if ${{ env.ACTION_TYPE == 'amend' }}; then
94+
perl -i -p0e "s/= $RELEASE_VERSION.*?(\n){2}//s" readme.txt # Delete the existing changelog for the release version first
95+
fi
6796
68-
sed -ri "s|(== Changelog ==)|\1\n\n= $RELEASE_VERSION - $RELEASE_DATE =\n$CHANGELOG|" readme.txt
97+
sed -ri "s|(== Changelog ==)|\1\n\n= $RELEASE_VERSION - $RELEASE_DATE =\n$CHANGELOG|" readme.txt
98+
fi

.github/workflows/compatibility.yml

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

66
env:
7-
WC_MIN_SUPPORTED_VERSION: '7.5.0'
7+
WC_MIN_SUPPORTED_VERSION: '7.6.0'
88
WP_MIN_SUPPORTED_VERSION: '6.0'
99
PHP_MIN_SUPPORTED_VERSION: '7.3'
1010

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,33 @@ jobs:
3333
with:
3434
version: ${{ env.RELEASE_VERSION }}
3535

36-
- name: "Create a test tag"
37-
id: create_tag
38-
uses: ./.github/actions/create-tag
39-
with:
40-
version: ${{ env.RELEASE_VERSION }}
41-
4236
- name: "Generate the changelog"
4337
id: generate_changelog
4438
uses: ./.github/actions/process-changelog
4539
with:
46-
release-version: ${{ steps.create_tag.outputs.trimmed-version }}
40+
release-version: ${{ steps.create_branch.outputs.trimmed-version }}
4741

4842
- name: "Bump version header"
4943
env:
50-
VERSION: ${{ steps.create_tag.outputs.trimmed-version }}
44+
VERSION: ${{ steps.create_branch.outputs.trimmed-version }}
5145
run: |
5246
sed -i "s/^ \* Version: .*$/ * Version: $VERSION/" woocommerce-payments.php
5347
48+
- name: "Commit and push changes"
49+
env:
50+
BRANCH_NAME: ${{ steps.create_branch.outputs.branch-name }}
51+
RELEASE_VERSION: ${{ steps.create_branch.outputs.trimmed-version }}
52+
uses: ./.github/actions/commit-push-as-bot
53+
with:
54+
release-version: ${{ env.RELEASE_VERSION }}
55+
branch: ${{ env.BRANCH_NAME }}
56+
57+
- name: "Create a test tag"
58+
id: create_tag
59+
uses: ./.github/actions/create-tag
60+
with:
61+
version: ${{ env.RELEASE_VERSION }}
62+
5463
- name: "Build the plugin"
5564
id: build_plugin
5665
uses: ./.github/actions/build

.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_MIN_SUPPORTED_VERSION: '7.5.0'
26+
WC_MIN_SUPPORTED_VERSION: '7.6.0'
2727
NODE_ENV: 'test'
2828

2929
jobs:

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

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

77
env:
88
WP_VERSION: latest
9-
WC_MIN_SUPPORTED_VERSION: '7.5.0'
9+
WC_MIN_SUPPORTED_VERSION: '7.6.0'
1010
GUTENBERG_VERSION: latest
1111
PHP_MIN_SUPPORTED_VERSION: '7.3'
1212

.github/workflows/release-pr.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,10 @@ jobs:
104104
env:
105105
RELEASE_VERSION: ${{ steps.create_branch.outputs.trimmed-version }}
106106
BRANCH_NAME: ${{ steps.create_branch.outputs.branch-name }}
107-
run: |
108-
git config user.name "github-actions[bot]"
109-
# We could consider fetching the bot's ID through an API call to be future-proof. Hardcoded for now.
110-
# See https://github.com/Automattic/woocommerce-payments/pull/5200#discussion_r1034560144
111-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
112-
git commit -am "Update version and add changelog entries for release $RELEASE_VERSION"
113-
git push --set-upstream origin $BRANCH_NAME
107+
uses: ./.github/actions/commit-push-as-bot
108+
with:
109+
release-version: ${{ env.RELEASE_VERSION }}
110+
branch: ${{ env.BRANCH_NAME }}
114111

115112
- name: "Create a PR to trunk"
116113
id: create-pr-to-trunk

assets/css/admin.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
background-size: contain;
131131
}
132132

133+
.payment-method__brand--afterpay_clearpay {
134+
background: no-repeat url( '../images/payment-methods/afterpay-icon.svg' );
135+
background-size: contain;
136+
}
137+
138+
.payment-method__brand--affirm {
139+
background: no-repeat url( '../images/payment-methods/affirm-icon.svg' );
140+
background-size: contain;
141+
}
142+
133143
.wc_gateways tr[data-gateway_id='woocommerce_payments'] .payment-method__icon {
134144
border: 1px solid #ddd;
135145
border-radius: 2px;
85.8 KB
Loading

0 commit comments

Comments
 (0)