-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflows: Sync assets to plugin repo upon change in trunk #68052
Merged
+48
−0
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eb000b3
Workflows: Sync blueprint when uploading GB to plugin repo
ockham 05db7c9
Specify local directory for svn checkout
ockham 4b8b600
Add existing assets from svn repo
ockham a6ceeb9
Sync all assets
ockham 515828c
Allow for addition/removal of files
ockham aec7218
Simplify file removal
ockham 01fdc4d
More awk, less grep
ockham 6968ef7
Remove unnecessary env var
ockham 8a599c2
Create new workflow for job
ockham 6514ea0
Use SHA instead of version
ockham 8371570
Indentation
ockham bd07fed
Fix
ockham 10aaba2
Remove line break
ockham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,3 +248,41 @@ 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' | ||
STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*' | ||
SVN_USERNAME: ${{ secrets.svn_username }} | ||
SVN_PASSWORD: ${{ secrets.svn_password }} | ||
VERSION: ${{ github.event.release.name }} | ||
ockham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 . -maxdepth 1 -not -name ".svn" -not -name "." -not -name ".." -exec rm -rf {} + | ||
ockham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- 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 | grep '^?' | awk '{print $2}' | xargs -r svn add | ||
svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm | ||
ockham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
svn commit "assets" \ | ||
-m "Sync assets for version $VERSION" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can swap the version for the commit sha. |
||
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ | ||
--config-option=servers:global:http-timeout=600 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to filter to:
trunk
branchassets/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably move the entire job to a whole new workflow file, with the trigger set accordingly 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8a599c2