Skip to content

Commit

Permalink
Added WP release code
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinc committed Oct 18, 2024
1 parent 0107275 commit 3338624
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ jobs:
--notes "Release ${{ steps.get_version.outputs.VERSION_WITH_V }}" \
dist/betterportal-theme-embedded-${{ steps.get_version.outputs.VERSION_WITH_V }}.zip
- name: Update SVN with latest code
run: |
chmod +x update-svn.sh
./update-svn.sh
- name: WordPress Plugin Deploy
uses: nk-o/action-wordpress-plugin-deploy@master
env:
SVN_PASSWORD: ${{ secrets.WORDPRESS_SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.WORDPRESS_SVN_USERNAME }}
SOURCE_DIR: release/src/
ASSETS_DIR: release/assets/
VERSION: ${{ steps.get_version.outputs.VERSION }}
SLUG: betterportal-theme-embedded

- name: Cleanup
if: always()
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist
/build
/build
/release
2 changes: 2 additions & 0 deletions envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SOURCE_DIR="$CURRENT_DIR/src"
export BUILD_DIR="$CURRENT_DIR/build"
export DIST_DIR="$CURRENT_DIR/dist"
export DIST_RELEASE_SRC_DIR="$CURRENT_DIR/release/src"
export DIST_RELEASE_ASSETS_DIR="$CURRENT_DIR/release/assets"

# File names
export MAIN_PHP_FILE="betterportal-theme-embedded.php"
Expand Down
7 changes: 7 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ source ./envs.sh

# Create the distribution directory if it doesn't exist
mkdir -p $DIST_DIR
mkdir -p $DIST_RELEASE_SRC_DIR
mkdir -p $DIST_RELEASE_ASSETS_DIR

# Change to the temporary directory and create the zip file
pushd $BUILD_DIR
zip -r $DIST_DIR/betterportal-theme-embedded-v$VERSION.zip . -x ".*" -x "__MACOSX"
popd

cp -rv "$BUILD_DIR/betterportal-theme-embedded/." $DIST_RELEASE_SRC_DIR
rm -rfv "$DIST_RELEASE_SRC_DIR/assets/"
cp -rv "$BUILD_DIR/betterportal-theme-embedded/assets/." $DIST_RELEASE_ASSETS_DIR

echo "Plugin zip file created: $DIST_DIR/betterportal-theme-embedded-v$VERSION.zip"
echo "WP Release ready: $DIST_RELEASE_SRC_DIR / $DIST_RELEASE_ASSETS_DIR"
6 changes: 0 additions & 6 deletions update-svn.sh

This file was deleted.

0 comments on commit 3338624

Please sign in to comment.