Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 0 additions & 98 deletions .github/scripts/publish-theme-to-wordpress-org-dry-run.sh

This file was deleted.

39 changes: 19 additions & 20 deletions .github/scripts/publish-theme-to-wordpress-org.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
#!/bin/bash
set -eo pipefail

if [[ -z "$SVN_USERNAME" ]]; then
echo "Set the SVN_USERNAME secret"
exit 1
fi

if [[ -z "$SVN_PASSWORD" ]]; then
echo "Set the SVN_PASSWORD secret"
exit 1
fi

if [[ -z "$THEME_VERSION" ]]; then
echo "Set the THEME_VERSION env var"
exit 1
Expand Down Expand Up @@ -46,26 +36,35 @@ if svn list "https://themes.svn.wordpress.org/hello-elementor/${VERSION_DIR}" >
fi

mkdir -p "$VERSION_DIR"
cd "$VERSION_DIR"
cd ..
svn add "$VERSION_DIR"
cd "$VERSION_DIR"

echo "Copy files"
rsync -ah --progress "$THEME_PATH/hello-elementor/"* . || rsync -ah --progress "$THEME_PATH/hello-elementor/." . || true
echo "Copy files from build directory"
rsync -ah --progress "$THEME_PATH/hello-elementor/"* "$VERSION_DIR"

echo "Preparing files"
cd "$VERSION_DIR"

echo "svn delete"
svn status | grep -v '^.[ \t]*\\..*' | { grep '^!' || true; } | awk '{print $2}' | xargs -r svn delete

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

echo "Print SVN Status changes"
svn status

cd $SVN_PATH

if [[ -z "$SVN_USERNAME" ]]; then
echo "Set the SVN_USERNAME secret"
exit 1
fi

if [[ -z "$SVN_PASSWORD" ]]; then
echo "Set the SVN_PASSWORD secret"
exit 1
fi

echo "Commit files to version folder $VERSION_DIR"
svn ci -m "Upload v${THEME_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"

cd $SVN_PATH
svn update

echo "Remove the SVN folder from the workspace"
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ permissions:

on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
description: 'Dry run mode (test without deploying)'
required: false
default: false

jobs:
build:
Expand Down Expand Up @@ -50,19 +44,13 @@ jobs:
sudo apt-get install -y subversion
which svn
svn --version
- name: Publish to WordPress.org SVN (Dry Run)
if: ${{ inputs.dry_run == true }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-theme-to-wordpress-org-dry-run.sh"
- name: Publish to WordPress.org SVN
if: ${{ inputs.dry_run == false }}
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-theme-to-wordpress-org.sh"
- name: Send Slack Notification
if: ${{ inputs.dry_run == false }}
uses: ./.github/actions/theme-slack-notification-release
with:
CLOUD_SLACK_BOT_TOKEN: ${{ secrets.CLOUD_SLACK_BOT_TOKEN }}
Expand Down
Loading