File tree Expand file tree Collapse file tree 3 files changed +19
-130
lines changed
Expand file tree Collapse file tree 3 files changed +19
-130
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -eo pipefail
33
4- if [[ -z " $SVN_USERNAME " ]]; then
5- echo " Set the SVN_USERNAME secret"
6- exit 1
7- fi
8-
9- if [[ -z " $SVN_PASSWORD " ]]; then
10- echo " Set the SVN_PASSWORD secret"
11- exit 1
12- fi
13-
144if [[ -z " $THEME_VERSION " ]]; then
155 echo " Set the THEME_VERSION env var"
166 exit 1
@@ -46,26 +36,35 @@ if svn list "https://themes.svn.wordpress.org/hello-elementor/${VERSION_DIR}" >
4636fi
4737
4838mkdir -p " $VERSION_DIR "
49- cd " $VERSION_DIR "
50- cd ..
51- svn add " $VERSION_DIR "
52- cd " $VERSION_DIR "
5339
54- echo " Copy files"
55- rsync -ah --progress " $THEME_PATH /hello-elementor/" * . || rsync -ah --progress " $THEME_PATH /hello-elementor/. " . || true
40+ echo " Copy files from build directory "
41+ rsync -ah --progress " $THEME_PATH /hello-elementor/" * " $VERSION_DIR "
5642
57- echo " Preparing files"
5843cd " $VERSION_DIR "
5944
45+ echo " svn delete"
46+ svn status | grep -v ' ^.[ \t]*\\..*' | { grep ' ^!' || true ; } | awk ' {print $2}' | xargs -r svn delete
47+
6048echo " svn add"
61- svn status | grep -v ' ^.[ \t]*\\..*' | { grep ' ^?' || true ; } | awk ' {print $2}' | xargs -r svn add || true
49+ svn status | grep -v ' ^.[ \t]*\\..*' | { grep ' ^?' || true ; } | awk ' {print $2}' | xargs -r svn add
6250
51+ echo " Print SVN Status changes"
6352svn status
6453
54+ cd $SVN_PATH
55+
56+ if [[ -z " $SVN_USERNAME " ]]; then
57+ echo " Set the SVN_USERNAME secret"
58+ exit 1
59+ fi
60+
61+ if [[ -z " $SVN_PASSWORD " ]]; then
62+ echo " Set the SVN_PASSWORD secret"
63+ exit 1
64+ fi
65+
6566echo " Commit files to version folder $VERSION_DIR "
6667svn ci -m " Upload v${THEME_VERSION} " --no-auth-cache --non-interactive --username " $SVN_USERNAME " --password " $SVN_PASSWORD "
67-
68- cd $SVN_PATH
6968svn update
7069
7170echo " Remove the SVN folder from the workspace"
Original file line number Diff line number Diff line change @@ -6,12 +6,6 @@ permissions:
66
77on :
88 workflow_dispatch :
9- inputs :
10- dry_run :
11- type : boolean
12- description : ' Dry run mode (test without deploying)'
13- required : false
14- default : false
159
1610jobs :
1711 build :
@@ -50,19 +44,13 @@ jobs:
5044 sudo apt-get install -y subversion
5145 which svn
5246 svn --version
53- - name : Publish to WordPress.org SVN (Dry Run)
54- if : ${{ inputs.dry_run == true }}
55- run : |
56- bash "${GITHUB_WORKSPACE}/.github/scripts/publish-theme-to-wordpress-org-dry-run.sh"
5747 - name : Publish to WordPress.org SVN
58- if : ${{ inputs.dry_run == false }}
5948 env :
6049 SVN_USERNAME : ${{ secrets.SVN_USERNAME }}
6150 SVN_PASSWORD : ${{ secrets.SVN_PASSWORD }}
6251 run : |
6352 bash "${GITHUB_WORKSPACE}/.github/scripts/publish-theme-to-wordpress-org.sh"
6453 - name : Send Slack Notification
65- if : ${{ inputs.dry_run == false }}
6654 uses : ./.github/actions/theme-slack-notification-release
6755 with :
6856 CLOUD_SLACK_BOT_TOKEN : ${{ secrets.CLOUD_SLACK_BOT_TOKEN }}
You can’t perform that action at this time.
0 commit comments