Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8cd1231
Allow point-releases for release branches that are not the latest any…
fullofcaffeine Mar 3, 2023
d685abb
Revert debug changes
fullofcaffeine Mar 14, 2023
8b939f8
Limit runs to `release/` branches
fullofcaffeine Apr 7, 2023
ff5c80f
Fix changelog directory interpolation
fullofcaffeine Apr 7, 2023
489aa70
Re-add debug changes for further testing
fullofcaffeine Apr 7, 2023
9dc4b39
Create only the tag when releasing an older point release, do not cre…
fullofcaffeine Apr 7, 2023
7438230
Implement guard against accidental trunk release of older point releases
fullofcaffeine Apr 15, 2023
237fd16
Attempt to fix "fetch" already defined error when running the script …
fullofcaffeine Apr 15, 2023
8934253
Simplify by not using node-fetch, or it will require installing the npm
fullofcaffeine Apr 15, 2023
0b06966
GH requires an user-agent
fullofcaffeine Apr 15, 2023
2cb1260
Improve var name and comments
fullofcaffeine Apr 18, 2023
1b0713b
Define func to set the output of the "compute-should-update-trunk" jo…
fullofcaffeine Apr 19, 2023
7ac820e
The core object should already be available as part of the github-scr…
fullofcaffeine Apr 19, 2023
b35880a
Rely only in the github ref from the published release and not the la…
fullofcaffeine Apr 19, 2023
a81bc68
Simplify further by moving the fetch core repo job to a step inside c…
fullofcaffeine Apr 19, 2023
60c465a
Fix/improve step/job ids
fullofcaffeine Apr 19, 2023
a370648
Fix typo
fullofcaffeine Apr 19, 2023
cd9bf15
Formatting fixes
fullofcaffeine Apr 19, 2023
e5e5764
Add missing outputs and a couple of other fixes
fullofcaffeine Apr 20, 2023
4297be6
A couple more fixes and a simplification of the compute_latest_versio…
fullofcaffeine Apr 20, 2023
014e2c6
Mock the build of the gutenberg.zip for debugging purposes, this comm…
fullofcaffeine Apr 21, 2023
dda3c46
Fix a couple of step names
fullofcaffeine Apr 21, 2023
cade53d
Re-add prelease attribute, was accidentally commented out
fullofcaffeine May 24, 2023
fe8b33c
Debug commit, please revert: mock the version number in the version repo
fullofcaffeine May 24, 2023
a37623b
Fix changelog fetching when uploading the SVN tag
fullofcaffeine May 25, 2023
ac78cac
Mock SVN version to 16.1.0
fullofcaffeine May 25, 2023
da46aba
Make the svn commit command verbose in order to debug network timeout…
fullofcaffeine May 25, 2023
b6a2f82
Revert "Make the svn commit command verbose in order to debug network…
fullofcaffeine May 25, 2023
86f4168
Optimize SVN tag addition in GitHub workflow
fullofcaffeine May 25, 2023
eae536a
Enhance safety checks in workflow to skip upload jobs for RC builds
fullofcaffeine May 26, 2023
d642211
Revert "Enhance safety checks in workflow to skip upload jobs for RC …
fullofcaffeine May 26, 2023
472262e
Skip upload jobs if release is an RC by checking the ref for a rc suffix
fullofcaffeine May 26, 2023
fae69ef
Revert build plugin mocking logic
fullofcaffeine Jun 1, 2023
6206fc7
Revert initial dev/debug changes
fullofcaffeine Jun 1, 2023
b2bde7d
Revert WP SVN repo version mock
fullofcaffeine Jun 1, 2023
73a5fc4
Add back if conditions that were accidentally removed
fullofcaffeine Jul 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize SVN tag addition in GitHub workflow
This commit significantly optimizes the process of adding a new tag to the SVN repository in our GitHub Workflow.

Previously, our process involved checking out the entire tags directory from the SVN repository, which led to increased execution time and failure points when the tags directory was filled with numerous versions.

We've resolved this issue by leveraging the svn import command, which allows us to directly add a new directory to the tags directory without checking out the existing directories first. This results in faster and more reliable workflow execution, particularly when dealing with repositories that have accumulated many tagged versions.

The changes made include:

    Removing the step to checkout Gutenberg tags from the WP.org plugin repository.
    Adding a new step that uses the svn import command to directly add a new version directory to the SVN repository. This is achieved without the need to checkout all existing directories under tags/.
    Removing the step to checkout the new Gutenberg tag as it's not needed anymore.
  • Loading branch information
fullofcaffeine committed May 25, 2023
commit 86f41681629c8ffe290615add3eb2b0daa1d8023
24 changes: 6 additions & 18 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,40 +230,28 @@ jobs:
VERSION: ${{ github.event.release.name }}

steps:
- name: Check out Gutenberg tags from WP.org plugin repo
run: svn checkout "$PLUGIN_REPO_URL/tags" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"

- name: Download and unzip Gutenberg plugin asset into tags folder
env:
PLUGIN_URL: ${{ github.event.release.assets[0].browser_download_url }}
run: |
# do the magic here
curl -L -o gutenberg.zip $PLUGIN_URL
unzip gutenberg.zip -d tags/$VERSION
unzip gutenberg.zip -d "$VERSION"
rm gutenberg.zip

- name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
env:
STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V'
run: |
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./tags/$VERSION/readme.txt
sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt"

- name: Download Changelog Artifact
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1
with:
# The name might be confusing here as this job is about a SVN tag and not trunk,
# but in this case `trunk` refers to something else not in the context of SVN.
# it's because the changelog is uploaded using this name in the `update-changelog`
# job above. The changelog is generated and committed to the *git* `trunk` and
# `release/vX.Y.Z` branches, and then the generated text file is stored uising
# the download-artifact action with this name.
name: changelog trunk
path: tags/${{ github.event.release.name }}
path: ${{ github.event.release.name }}

- name: Commit the content changes
working-directory: ./tags
- name: Add the new version directory and commit changes to the SVN repository
run: |
svn st | grep '^?' | awk '{print $2}' | xargs -r svn add
svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm
svn commit -m "Committing version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"