-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from helgatheviking/features/block
Features/block
- Loading branch information
Showing
29 changed files
with
36,862 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
/.github | ||
/node_modules | ||
/build | ||
/src | ||
|
||
*.sublime-project | ||
*.afdesign | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,147 @@ | ||
name: Deploy to WordPress.org | ||
# Add build zip to GitHub releases. | ||
# Version: 1.1.0 | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- 'v*-alpha*' | ||
- 'v*-beta*' | ||
- 'v*-rc*' | ||
tags: | ||
# Semver (https://semver.org/) release pattern. | ||
- '[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
tag: | ||
name: New tag | ||
# 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. | ||
# - Check for Alpha release. | ||
# - Check for Beta release. | ||
# - Check for Release Candidate release. | ||
# - Logs debug information. | ||
# - Build release: | ||
# - Pre-release. | ||
# - Stable. | ||
# - Add package to GitHub releases. | ||
|
||
dist: | ||
name: "Build distribution release." | ||
runs-on: ubuntu-latest | ||
env: | ||
release: stable | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Build # Remove or modify this step as needed | ||
run: | | ||
npm install | ||
npm run build | ||
- name: WordPress Plugin Deploy | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
env: | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SLUG: simple-user-listing | ||
|
||
- name: "Checks out the repository." | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Sets up PHP with Composer." | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Get Composer Cache Directory." | ||
id: composer-cache | ||
run: | | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: "Sets up Composer Caching." | ||
uses: "actions/cache@v4" | ||
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@v4 | ||
with: | ||
node-version: '16' | ||
|
||
- name: "Get NPM cache directory." | ||
id: npm-cache-dir | ||
run: | | ||
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
- name: "Sets up NPM Caching." | ||
uses: actions/cache@v4 | ||
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 | ||
- name: "Get release file base name." | ||
run: | | ||
echo "release_name=$(node -p -e "require('./package.json').name")" >> $GITHUB_ENV | ||
- name: "Check for Alpha release." | ||
if: ${{ contains(env.release_tag, '-alpha') }} | ||
run: | | ||
echo "release_status=pre-release" >> $GITHUB_ENV | ||
- name: "Check for Beta release." | ||
if: ${{ contains(env.release_tag, '-beta') }} | ||
run: | | ||
echo "release_status=pre-release" >> $GITHUB_ENV | ||
- name: "Check for Release Candidate release." | ||
if: ${{ contains(env.release_tag, '-rc') }} | ||
run: | | ||
echo "release_status=pre-release" >> $GITHUB_ENV | ||
- name: "Logs debug information." | ||
run: | | ||
node --version | ||
npm --version | ||
echo ${{ env.release_tag }} | ||
echo ${{ env.release_status }} | ||
- name: "Build release" | ||
run: | | ||
npm run deploy | ||
- name: "Add package to GitHub releases." | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ./deploy/${{ env.release_name }}-${{ env.release_tag }}.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Deploy Stable Release to WordPress.org" | ||
if: ${{ env.release_status != 'pre-release' }} | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
env: | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SLUG: simple-user-listing | ||
BUILD_DIR: ./build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
node_modules/ | ||
vendor/ | ||
build/ | ||
*.DS_Store | ||
*.afdesign | ||
.cache/ | ||
*.sublime-workspace | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"require-dev": { | ||
"wp-cli/i18n-command": "^2.6" | ||
}, | ||
"scripts": { | ||
"makepot-audit": [ | ||
"wp --allow-root i18n make-pot . languages/free_gift_coupons.pot --slug=wc_free_gift_coupons --exclude=\".github,.wordpress-org,node_modules,vendor,src,build,deploy\" --headers=\"Report-Msgid-Bugs-To: https://woocommerce.com/my-account/tickets/\n\"" | ||
], | ||
"makepot": [ | ||
"@makepot-audit --skip-audit" | ||
] | ||
} | ||
} |
Oops, something went wrong.