Skip to content

Commit

Permalink
Merge branch 'master' into ft-wp-env
Browse files Browse the repository at this point in the history
  • Loading branch information
hansmorb committed Sep 25, 2023
2 parents cae4f4b + 1e7cdef commit d574d95
Show file tree
Hide file tree
Showing 13 changed files with 723 additions and 637 deletions.
38 changes: 20 additions & 18 deletions .distignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/.github
/.saas-cache
/bin
/tests
/.git
/.saas-cache
.distignore
.editorconfig
.phpcs.xml.dist
.gitignore
.*
.*/
*.lock
*.md
*.zip
*.sh
/bin/
/build/
/node_modules/
/tests/
composer.*
Gruntfile.js
codecov.yml
commonsbooking.zip
composer.json
composer.lock
copy-svn.sh
gruntfile.js
package.json
none
package-lock.json
package.json
phpcs.xml
phpunit.xml
phpunit.xml.dist
zipdist.sh
phpunit
project.json
README.md

tsconfig.*
webpack.config.js
37 changes: 37 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create release
on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-20.04
steps:

- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.6' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install compass

- uses: actions/setup-node@v2
with:
node-version: 12

- name: Run build script
run: bin/build-zip.sh

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: commonsbooking.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 1 addition & 6 deletions .github/workflows/wordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to WordPress.org
on:
push:
tags:
- "v*.*.*"
- "*"

jobs:
deploy:
Expand Down Expand Up @@ -35,11 +35,6 @@ jobs:
uses: elstudio/actions-js-build/build@v4
with:
args: build

- name: Commit changes
uses: elstudio/actions-js-build/commit@v4
with:
commitMessage: Ran grunt

- name: Build # Remove or modify this step as needed
run: |
Expand Down
32 changes: 32 additions & 0 deletions bin/build-zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
# Borrows from https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/bin/build-zip.sh

PLUGIN_SLUG="commonsbooking"
PROJECT_PATH=$(pwd)
BUILD_PATH="${PROJECT_PATH}/build"
DEST_PATH="$BUILD_PATH/$PLUGIN_SLUG"

echo "Generating build directory..."
rm -rf "$BUILD_PATH"
mkdir -p "$DEST_PATH"

echo "Installing PHP and JS dependencies..."
npm ci
echo "Running JS Build..."
grunt dist || exit "$?"
echo "Cleaning up PHP dependencies..."
composer install --no-dev --ignore-platform-reqs || exit "$?"
echo "Run makepot..."
wp i18n make-pot . languages/commonsbooking.pot
echo "Syncing files..."
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded

echo "Generating zip file..."
cd "$BUILD_PATH" || exit
zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/"

cd "$PROJECT_PATH" || exit
mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH"
echo "${PLUGIN_SLUG}.zip file generated!"

echo "Build done!"
4 changes: 2 additions & 2 deletions commonsbooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Plugin Name: Commons Booking
* Version: 2.8.3
* Version: 2.8.4
* Requires at least: 5.2
* Requires PHP: 7.4
* Plugin URI: https://commonsbooking.org
Expand All @@ -18,7 +18,7 @@
use CommonsBooking\Plugin;

defined('ABSPATH') or die("Thanks for visting");
define('COMMONSBOOKING_VERSION', '2.8.3');
define('COMMONSBOOKING_VERSION', '2.8.4');
define('COMMONSBOOKING_PLUGIN_SLUG', 'commonsbooking');
define('COMMONSBOOKING_MENU_SLUG', COMMONSBOOKING_PLUGIN_SLUG . '-menu');
define('COMMONSBOOKING_PLUGIN_DIR', wp_normalize_path( plugin_dir_path(__FILE__)));
Expand Down
Binary file modified languages/commonsbooking-de_DE.mo
Binary file not shown.
Loading

0 comments on commit d574d95

Please sign in to comment.