Skip to content
Draft
Changes from 5 commits
Commits
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
44 changes: 29 additions & 15 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:
if: |
needs.compute-should-update-trunk.outputs.should_update_trunk == 'true' && github.event.release.assets[0]
env:
PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
PLUGIN_REPO_URL: ${{ vars.WP_ORG_PLUGIN_REPO_URL }}
Comment thread
desrosj marked this conversation as resolved.
Comment thread
desrosj marked this conversation as resolved.
STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
Comment thread
desrosj marked this conversation as resolved.
Outdated
SVN_USERNAME: ${{ secrets.svn_username }}
SVN_PASSWORD: ${{ secrets.svn_password }}
Expand All @@ -201,7 +201,6 @@ jobs:
- name: Check out Gutenberg trunk from WP.org plugin repo
run: |
svn checkout "$PLUGIN_REPO_URL/trunk" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
svn checkout "$PLUGIN_REPO_URL/tags" --depth=immediates --username "$SVN_USERNAME" --password "$SVN_PASSWORD"

- name: Delete everything
working-directory: ./trunk
Expand Down Expand Up @@ -249,18 +248,31 @@ jobs:
fi
rm -f "$svn_error_file"

- name: Commit the release
- name: Add new files
if: steps.check_svn_tag.outputs.exists != 'true'
working-directory: ./trunk
run: svn st | grep '^?' | awk '{print $2}' | xargs -r svn add

- name: Remove deleted files
if: steps.check_svn_tag.outputs.exists != 'true'
working-directory: ./trunk
run: svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm

- name: Commit changes
if: steps.check_svn_tag.outputs.exists != 'true'
working-directory: ./trunk
run: |
svn st | grep '^?' | awk '{print $2}' | xargs -r svn add
svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm
svn cp . "../tags/$VERSION"
svn commit . "../tags/$VERSION" \
-m "Releasing version $VERSION" \
svn commit -m "Releasing version $VERSION" \
Comment thread
desrosj marked this conversation as resolved.
Outdated
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=600

- name: Tag the new version
if: steps.check_svn_tag.outputs.exists != 'true'
run: |
svn cp "$PLUGIN_REPO_URL/trunk" "$PLUGIN_REPO_URL/tags/$VERSION" \
-m "Tagging version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
Comment thread
desrosj marked this conversation as resolved.
Outdated

upload-tag:
name: Publish as tag
runs-on: 'ubuntu-24.04'
Expand All @@ -270,7 +282,7 @@ jobs:
if: |
needs.compute-should-update-trunk.outputs.should_update_trunk == 'false' && github.event.release.assets[0]
env:
PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
PLUGIN_REPO_URL: ${{ vars.WP_ORG_PLUGIN_REPO_URL }}
Comment thread
desrosj marked this conversation as resolved.
STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
Comment thread
desrosj marked this conversation as resolved.
Outdated
SVN_USERNAME: ${{ secrets.svn_username }}
SVN_PASSWORD: ${{ secrets.svn_password }}
Expand All @@ -284,11 +296,13 @@ jobs:
- 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 "$VERSION"
rm gutenberg.zip
run: curl -L -o gutenberg.zip "$PLUGIN_URL"

- name: Unzip plugin zip
run: unzip gutenberg.zip -d "$VERSION"

- name: Remove zip file
run: rm gutenberg.zip

- name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
env:
Expand Down Expand Up @@ -329,4 +343,4 @@ jobs:
run: |
svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=300
--config-option=servers:global:http-timeout=600
Loading