Showing 311 changed files with 112,139 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.git
CONTRIBUTING.md
.distignore
.gitignore
.travis.yml
.jshintrc
.commitlintrc.js
docker-compose.yml
Gruntfile.js
grunt
phpcs.xml
node_modules
logs
e2e-tests
cypress.json
.eslintignore
.eslintrc.js
.releaserc.yml
.gitattributes
.babelrc
.eslintrc
.github
package.json
bin
tests
phpunit.xml
npm-debug.log
package-lock.json
webpack.config.js
dist
.nvmrc
.editorconfig
artifact
composer.json
composer.lock
themeisle.enc

assets/css/src
assets/js/src

.idea
vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php
**/*.css.map
.DS_Store
blackfire
rollup.config.js
docker-compose.ci.yml
visual-regressions
yarn.lock
.ds_store
.storybook
stories
cypress.storybook.json
tsconfig.json
lint-staged.config.js
.stylelintrc.json
phpstan.neon
.gitkeep
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Summary
<!-- Please describe the changes you made. -->

### Will affect visual aspect of the product
<!-- It includes visual changes? -->
YES/NO

### Screenshots
<!-- if applicable -->

### Test instructions
<!-- Describe how this pull request can be tested. -->

-
-

<!-- Issues that this pull request closes. -->
Closes #.
<!-- Should look like this: `Closes #1, closes #2, closes #3.` . -->
99 changes: 99 additions & 0 deletions .github/workflows/create-build-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build and publish the ZIP build file

on:
pull_request:
types: [ opened, synchronize, ready_for_review ]
branches-ignore:
- "update_dependencies"
jobs:
dev-zip:
name: Build ZIP and upload to s3
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
outputs:
branch-name: ${{ steps.retrieve-branch-name.outputs.branch_name }}
git-sha-8: ${{ steps.retrieve-git-sha-8.outputs.sha8 }}
steps:
- name: Check out source files
uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Configure Composer cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer deps
run: composer install --no-dev --prefer-dist --no-progress --no-suggest
- name: Install yarn deps
run: yarn install --frozen-lockfile
- name: Build files
run: yarn run build
- name: Create zip
run: yarn run dist
- name: Retrieve branch name
id: retrieve-branch-name
run: echo "::set-output name=branch_name::$(REF=${GITHUB_HEAD_REF:-$GITHUB_REF} && echo ${REF#refs/heads/} | sed 's/\//-/g')"
- name: Retrieve git SHA-8 string
id: retrieve-git-sha-8
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Upload Latest Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_DEV_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_KEY_ARTIFACTS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_ARTIFACTS }}
SOURCE_DIR: artifact/
DEST_DIR: ${{ github.event.pull_request.base.repo.name }}-${{ steps.retrieve-branch-name.outputs.branch_name }}-${{ steps.retrieve-git-sha-8.outputs.sha8 }}/

comment-on-pr:
name: Comment on PR with links to plugin ZIPs
if: ${{ github.head_ref && github.head_ref != null }}
runs-on: ubuntu-latest
needs: dev-zip
env:
CI: true
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
outputs:
pr_number: ${{ steps.get-pr-number.outputs.num }}
comment_body: ${{ steps.get-comment-body.outputs.body }}
steps:
- name: Get PR number
id: get-pr-number
run: echo "::set-output name=num::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')"

- name: Check if a comment was already made
id: find-comment
uses: peter-evans/find-comment@v1
with:
issue-number: ${{ steps.get-pr-number.outputs.num }}
comment-author: github-actions[bot]
body-includes: Download PPOM

- name: Get comment body
id: get-comment-body
run: |
body="Plugin build for ${{ github.event.pull_request.head.sha }} is ready :bellhop_bell:!
- Download PPOM - [build 🔗](https://verti-artifacts.s3.amazonaws.com/${{ github.event.pull_request.base.repo.name }}-${{ needs.dev-zip.outputs.branch-name }}-${{ needs.dev-zip.outputs.git-sha-8 }}/woocommerce-product-addon.zip)"
body="${body//$'\n'/'%0A'}"
echo "::set-output name=body::$body"
- name: Create comment on PR with links to plugin builds
if: ${{ steps.find-comment.outputs.comment-id == '' }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ steps.get-pr-number.outputs.num }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update comment on PR with links to plugin builds
if: ${{ steps.find-comment.outputs.comment-id != '' }}
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: ${{ steps.get-comment-body.outputs.body }}
56 changes: 56 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
branches:
- master
jobs:
create_tag:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
- name: Build files using ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Release new version
id: release
run: |
yarn install --frozen-lockfile
composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
yarn run build
yarn run release
env:
CI: true
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GIT_AUTHOR_NAME: themeisle[bot]
GIT_AUTHOR_EMAIL: ${{ secrets.PIRATE_BOT_EMAIL }}
GIT_COMMITTER_NAME: themeisle[bot]
GIT_COMMITTER_EMAIL: ${{ secrets.PIRATE_BOT_EMAIL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_ANNOUNCEMENTS }}
SEMANTIC_RELEASE_PACKAGE: PPOM(free)
empty-job:
# if no jobs run, github action considers it a test failure -- which seems like a bug
# this makes it so the top-level if statement for the job does not give status failure.
runs-on: ubuntu-latest
if: success()
steps:
- name: Meep
run: |
echo "Nothing to do"
62 changes: 62 additions & 0 deletions .github/workflows/deploy-s3-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy

on:
push:
tags:
- "*"
jobs:
deploy:
name: Deploy to server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup node 14
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build & create dist/artifact
run: |
yarn install --frozen-lockfile
composer install --no-dev --prefer-dist --no-progress --no-suggest
yarn run build
yarn run dist
- name: Upload Latest Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_DOWNLOADS }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DOWNLOADS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DOWNLOADS_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'artifact' # optional: defaults to entire repository
DEST_DIR: ${{ secrets.S3_AWS_PRODUCTS_FOLDER }}/$BUILD_NAME/latest
- name: Upload Tagged Version to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_DOWNLOADS }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DOWNLOADS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DOWNLOADS_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
SOURCE_DIR: 'artifact' # optional: defaults to entire repository
DEST_DIR: ${{ secrets.S3_AWS_PRODUCTS_FOLDER }}/$BUILD_NAME/$BUILD_VERSION
- name: Send update to the store
env:
PRODUCT_ID: ${{ secrets.THEMEISLE_ID }}
AUTH_TOKEN: ${{ secrets.THEMEISLE_STORE_AUTH }}
STORE_URL: ${{ secrets.THEMEISLE_STORE_URL }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
BUILD_VERSION: ${{ env.BUILD_VERSION }}
uses: Codeinwp/action-store-release@main
21 changes: 21 additions & 0 deletions .github/workflows/deploy-svn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploy
on:
push:
tags:
- "*"
jobs:
tag:
name: New version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build
run: |
yarn install --frozen-lockfile
yarn run build
composer install --no-dev --prefer-dist --no-progress --no-suggest
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
SVN_PASSWORD: ${{ secrets.SVN_THEMEISLE_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_THEMEISLE_USERNAME }}
22 changes: 22 additions & 0 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync branches
on:
push:
branches:
- 'master'
jobs:
sync-branch:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Codeinwp' }} # Disable on forks
steps:
- uses: actions/checkout@master
- name: Retrieve branch name
id: retrieve-branch-name
run: echo "::set-output name=branch_name::$(REF=${GITHUB_HEAD_REF:-$GITHUB_REF} && echo ${REF#refs/heads/} | sed 's/\//-/g')"
- name: Merge master -> development
if: ${{ steps.retrieve-branch-name.outputs.branch_name == 'master' }}
uses: Codeinwp/merge-branch@master
with:
type: now
from_branch: master
target_branch: development
github_token: ${{ secrets.BOT_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/sync-wporg-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Sync assets with wordpress.org

on:
push:
branches:
- master
paths:
- 'readme.txt'
- '.wordpress-org/**'
jobs:
run:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, 'chore(release)')"
name: Push assets to wporg
steps:
- uses: actions/checkout@master
- name: WordPress.org plugin asset/readme update
uses: selul/action-wordpress-plugin-asset-update@develop
env:
SVN_PASSWORD: ${{ secrets.SVN_THEMEISLE_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_THEMEISLE_USERNAME }}
Loading