Skip to content

Commit 47bfbf2

Browse files
committed
Update publish script
1 parent ab9648f commit 47bfbf2

File tree

3 files changed

+8
-118
lines changed

3 files changed

+8
-118
lines changed

.github/scripts/publish-theme-to-wordpress-org-dry-run.sh

Lines changed: 0 additions & 98 deletions
This file was deleted.

.github/scripts/publish-theme-to-wordpress-org.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,26 @@ if svn list "https://themes.svn.wordpress.org/hello-elementor/${VERSION_DIR}" >
4646
fi
4747

4848
mkdir -p "$VERSION_DIR"
49-
cd "$VERSION_DIR"
50-
cd ..
5149
svn add "$VERSION_DIR"
5250
cd "$VERSION_DIR"
5351

54-
echo "Copy files"
52+
echo "Copy files from build directory"
5553
rsync -ah --progress "$THEME_PATH/hello-elementor/"* . || rsync -ah --progress "$THEME_PATH/hello-elementor/." . || true
5654

57-
echo "Preparing files"
58-
cd "$VERSION_DIR"
55+
echo "Preparing files for SVN"
56+
57+
echo "svn delete"
58+
svn status | grep -v '^\?[ \t]*\.$' | { grep '^!' || true; } | awk '{print $2}' | xargs -r svn delete || true
5959

6060
echo "svn add"
61-
svn status | grep -v '^.[ \t]*\\..*' | { grep '^?' || true; } | awk '{print $2}' | xargs -r svn add || true
61+
svn status | grep -v '^\?[ \t]*\.$' | { grep '^?' || true; } | awk '{print $2}' | xargs -r svn add || true
6262

6363
svn status
6464

65+
cd $SVN_PATH
66+
6567
echo "Commit files to version folder $VERSION_DIR"
6668
svn ci -m "Upload v${THEME_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
67-
68-
cd $SVN_PATH
6969
svn update
7070

7171
echo "Remove the SVN folder from the workspace"

.github/workflows/deploy.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ permissions:
66

77
on:
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

1610
jobs:
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 }}

0 commit comments

Comments
 (0)