Skip to content

Commit

Permalink
Create new workflow for job
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Dec 18, 2024
1 parent 6968ef7 commit 8a599c2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 37 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/sync-assets-to-plugin-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Sync Gutenberg plugin assets to WordPress.org plugin repo

on:
push:
branches:
- trunk
paths:
- assets

jobs:
sync-assets:
name: Sync assets to WordPress.org plugin repo
runs-on: ubuntu-latest
environment: wp.org plugin
env:
PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}

steps:
- name: Check out Gutenberg assets folder from WP.org plugin repo
run: |
svn checkout "$PLUGIN_REPO_URL/assets" \
--username "$SVN_USERNAME" --password "$SVN_PASSWORD"
- name: Delete everything
working-directory: ./assets
run: find assets -type f -not -path 'assets/.svn/*' -delete
- name: Checkout assets from current release
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
assets
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Commit the updated assets
run: |
svn st | awk '/^?/ {print $2}' | xargs -r svn add
svn st | awk '/^!/ {print $2}' | xargs -r svn rm
svn commit assets \
-m "Sync assets for version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=600
37 changes: 0 additions & 37 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,40 +248,3 @@ jobs:
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
sync-assets:
name: Sync assets
runs-on: ubuntu-latest
environment: wp.org plugin
if: ${{ github.event.release.assets[0] }}
env:
PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
SVN_USERNAME: ${{ secrets.svn_username }}
SVN_PASSWORD: ${{ secrets.svn_password }}
VERSION: ${{ github.event.release.name }}

steps:
- name: Check out Gutenberg assets folder from WP.org plugin repo
run: |
svn checkout "$PLUGIN_REPO_URL/assets" assets \
--username "$SVN_USERNAME" --password "$SVN_PASSWORD"
- name: Delete everything
working-directory: ./assets
run: find assets -type f -not -path 'assets/.svn/*' -delete

- name: Checkout assets from current release
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
assets
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Commit the updated assets
run: |
svn st | awk '/^?/ {print $2}' | xargs -r svn add
svn st | awk '/^!/ {print $2}' | xargs -r svn rm
svn commit "assets" \
-m "Sync assets for version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=600

0 comments on commit 8a599c2

Please sign in to comment.