Skip to content

Commit

Permalink
Merge branch 'issues/2.2.0-compat'
Browse files Browse the repository at this point in the history
  • Loading branch information
helgatheviking committed Sep 12, 2022
2 parents be61d9e + 39ea281 commit 17e8181
Show file tree
Hide file tree
Showing 11 changed files with 774 additions and 130 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Add build zip to GitHub releases.
# Version: 1.1.0

name: Release

on:
push:
tags:
# Semver (https://semver.org/) release pattern.
- '[0-9]+.[0-9]+.[0-9]+*'

jobs:
# Build distribution release.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP with Composer.
# - Logs debug information.
# - Get Composer Cache Directory.
# - Sets up Composer Caching..
# - Logs debug information.
# - Install Composer dependencies with development dependencies.
# - Setup NodeJS.
# - Get NPM cache directory.
# - Sets up NPM Caching.
# - Install NPM dependencies.
# - Get release version.
# - Logs debug information.
# - Build release.
# - Add package to GitHub releases.

dist:
name: "Build distribution release."
runs-on: ubuntu-latest
steps:

- name: "Checks out the repository."
uses: "actions/checkout@v2"

- name: "Sets up PHP with Composer."
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Get Composer Cache Directory."
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Sets up Composer Caching."
uses: "actions/cache@v2"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-composer-build-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-composer-build-
- name: "Logs debug information."
run: |
php --version
composer --version
- name: "Install Composer dependencies with development dependencies."
run: |
composer install --no-interaction --prefer-dist --no-scripts
- name: "Setup NodeJS."
uses: actions/setup-node@v2
with:
node-version: '14'

- name: "Get NPM cache directory."
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: "Sets up NPM Caching."
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-npm-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-npm-build-
- name: "Install NPM dependencies."
run: npm install

- name: "Get release version."
run: |
echo "release_tag=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
echo "release_name=$(node -p -e "require('./package.json').name")" >> $GITHUB_ENV
- name: "Logs debug information."
run: |
node --version
npm --version
echo ${{ env.release_tag }}
- name: "Build release."
run: |
npm run release
- name: Rename output file
run: mv ./deploy/${{ env.release_tag }}/${{ env.release_name }}.zip ./deploy/${{ env.release_tag }}/${{ env.release_name }}-${{ env.release_tag }}.zip

- name: "Add package to GitHub releases."
uses: softprops/action-gh-release@v1
with:
files: ./deploy/${{ env.release_tag }}/${{ env.release_name }}-${{ env.release_tag }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
build/
deploy/
package-lock.json
assets/js/frontend/*.min.js
assets/js/backend/*.min.js
languages/
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,
"multistr": true,

"browser": true,

"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"JSON": false,
"wp": false,
"wc_mnm_params": false,
"wc_mnm_admin_order_params": false
}
}
Loading

0 comments on commit 17e8181

Please sign in to comment.