forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (41 loc) · 1.79 KB
/
sync-assets-to-plugin-repo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
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' }}
path: git
- name: Copy files from git checkout to svn working copy
run: cp -R git/assets/* assets
- name: Commit the updated assets
working-directory: ./assets
run: |
svn st | awk '/^?/ {print $2}' | xargs -r svn add
svn st | awk '/^!/ {print $2}' | xargs -r svn rm
svn commit . \
-m "Sync assets for commit $GITHUB_SHA" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=600