-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
10upbot on GitHub
committed
Jul 6, 2023
1 parent
7e1dd94
commit c16e954
Showing
116 changed files
with
4,187 additions
and
7,220 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 |
---|---|---|
|
@@ -9,30 +9,53 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.4.0 | ||
uses: actions/checkout@v3.5.3 | ||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Set PHP version | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2, wp | ||
|
||
- name: Clone stable branch to the release folder | ||
env: | ||
GITHUB_REPOSITORY: ${{ github.event.repository.name }} | ||
run: | | ||
git clone --depth 1 --branch stable https://github.com/$GITHUB_REPOSITORY.git release | ||
cd release | ||
git branch --show-current | ||
mv .git $RUNNER_TEMP/.git | ||
cd .. | ||
- name: Check versions | ||
run: npm -v; node -v | ||
run: | | ||
npm -v | ||
node -v | ||
php -v | ||
composer -v | ||
- name: Install and build | ||
run: | | ||
composer install --no-dev | ||
npm install | ||
npm run makepot | ||
npm run release | ||
- name: Push to Stable | ||
env: | ||
GITHUB_REPOSITORY: ${{ github.event.repository.name }} | ||
GITHUB_SHA: ${{ github.event.commits[0].sha }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cd release | ||
mv $RUNNER_TEMP/.git .git | ||
git branch --show-current | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "10upbot on GitHub" | ||
git remote set-url origin "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git" | ||
cd release | ||
git add . | ||
git commit -m "Committing built version of $GITHUB_SHA" | ||
git push origin stable | ||
git push origin HEAD:stable |
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
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,49 @@ | ||
name: Generate ZIP | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'Git Commit Ref (branch, tag, or hash)' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
generate_zip: | ||
name: New ZIP file | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Set PHP version | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2, wp | ||
- name: Check versions | ||
run: | | ||
npm -v | ||
node -v | ||
php -v | ||
composer -v | ||
- name: Install and build | ||
run: | | ||
composer install --no-dev | ||
npm install | ||
npm run release | ||
npm run plugin-zip | ||
rm -rf ./release && unzip ${{ github.event.repository.name }}.zip -d ./release | ||
- name: Upload the ZIP file as an artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: release | ||
retention-days: 5 |
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 |
---|---|---|
|
@@ -25,53 +25,61 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Cache Node | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache | ||
~/.npm | ||
key: ${{ hashFiles('package-lock.json') }} | ||
- name: Check versions | ||
run: npm -v; node -v | ||
- name: npm install | ||
run: npm install | ||
- name: eslint | ||
uses: icrawl/action-eslint@v1 | ||
- name: Generate linting report | ||
run: npm run lint:js -- --output-file eslint-report.json --format json | ||
continue-on-error: true | ||
- name: Annotate code linting results | ||
uses: ataylorme/[email protected] | ||
with: | ||
custom-glob: assets/js | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' | ||
report-json: 'eslint-report.json' | ||
- name: Update summary | ||
run: | | ||
npm_config_yes=true npx github:10up/eslint-json-to-md --path ./eslint-report.json --output ./eslint-report.md | ||
cat eslint-report.md >> $GITHUB_STEP_SUMMARY | ||
if: ${{ failure() }} | ||
|
||
phpcs: | ||
name: phpcs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: changed-files | ||
uses: tj-actions/changed-files@v36 | ||
with: | ||
files: | | ||
**/*.php | ||
- name: Set standard 10up cache directories | ||
run: | | ||
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}" | ||
- name: Prepare composer cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE }} | ||
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
composer-${{ env.COMPOSER_VERSION }}- | ||
- name: Set PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
coverage: none | ||
tools: composer:v2, cs2pr | ||
- name: Set PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2, cs2pr | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install --ignore-platform-reqs | ||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Check PHPCS standard | ||
run: ./vendor/bin/phpcs -i | ||
- name: Test all files | ||
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/trunk' }} | ||
run: ./vendor/bin/phpcs . --report-full --report-checkstyle=./.github/phpcs-report.xml | ||
|
||
- name: PHPCS check | ||
id: phpcs-sniffs | ||
run: ./vendor/bin/phpcs . --runtime-set testVersion 5.6- --report-full --report-checkstyle=./.github/phpcs-report.xml | ||
- name: Test changed files | ||
if: ${{ steps.changed-files.outputs.any_changed == 'true' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/trunk' }} | ||
run: ./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }} --report-full --report-checkstyle=./.github/phpcs-report.xml --runtime-set testVersion 7.4- | ||
|
||
- name: Show PHPCS results in PR | ||
if: ${{ always() }} | ||
run: cs2pr ./.github/phpcs-report.xml | ||
- name: Show PHPCS results in PR | ||
if: ${{ always() }} | ||
run: cs2pr ./.github/phpcs-report.xml |
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,20 @@ | ||
name: "WordPress version checker" | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- trunk | ||
pull_request: | ||
branches: | ||
- develop | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
|
||
jobs: | ||
wordpress-version-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: WordPress version checker | ||
uses: skaut/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.