From 091dadd1c23aaec2f99fb1b0378b91c0816459e0 Mon Sep 17 00:00:00 2001 From: Oscar Arzola Date: Wed, 22 May 2024 09:07:50 -0400 Subject: [PATCH] fix: dependabot and ci updates --- .github/dependabot.yml | 49 +++++++--- .github/workflows/build-and-lint.yml | 34 ------- .github/workflows/create-release.yml | 11 +++ .github/workflows/ensure-npm-build.yml | 10 +++ .github/workflows/standards-and-tests.yml | 104 ---------------------- .github/workflows/tests.yml | 31 +++++++ .nvmrc | 1 + .release-please-manifest.json | 3 + README.md | 10 +-- excalibur.php | 38 ++++---- release-please-config.json | 11 +++ 11 files changed, 128 insertions(+), 174 deletions(-) delete mode 100644 .github/workflows/build-and-lint.yml create mode 100644 .github/workflows/create-release.yml create mode 100644 .github/workflows/ensure-npm-build.yml delete mode 100644 .github/workflows/standards-and-tests.yml create mode 100644 .github/workflows/tests.yml create mode 100644 .nvmrc create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 604a1f8..51c56a8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,27 +1,48 @@ version: 2 updates: - # Maintain dependencies for npm - - package-ecosystem: "npm" - # Look for `package.json` and `package-lock.json` files in the root directory + # Maintain dependencies for Composer + - package-ecosystem: "composer" directory: "/" - # Check for updates weekly schedule: interval: "weekly" allow: - # Allow direct updates only (for packages named in package.json) - dependency-type: "direct" - # Allow up to 10 open pull requests for npm dependencies - open-pull-requests-limit: 10 + open-pull-requests-limit: 5 + versioning-strategy: "increase-if-necessary" + ignore: + - dependency-name: "*" + update-types: [ "version-update:semver-major" ] + groups: + composer-dependencies: + dependency-type: "production" + composer-dev-dependencies: + dependency-type: "development" - # Maintain dependencies for Composer - - package-ecosystem: "composer" - # Look for `composer.json` and `composer.lock` files in the root directory + # Maintain dependencies for npm + - package-ecosystem: "npm" directory: "/" - # Check for updates weekly schedule: interval: "weekly" allow: - # Allow direct updates only (for packages named in composer.json) - dependency-type: "direct" - # Allow up to 10 open pull requests for composer dependencies - open-pull-requests-limit: 10 + open-pull-requests-limit: 5 + versioning-strategy: "increase-if-necessary" + ignore: + - dependency-name: "*" + update-types: [ "version-update:semver-major" ] + groups: + npm-dependencies: + dependency-type: "production" + npm-dev-dependencies: + dependency-type: "development" + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + all-github-actions: + patterns: + - ".*" diff --git a/.github/workflows/build-and-lint.yml b/.github/workflows/build-and-lint.yml deleted file mode 100644 index 804e418..0000000 --- a/.github/workflows/build-and-lint.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build & Lint -on: - push: - branches: [ dev, master ] - tags: - - '*.*.*' - pull_request: - branches: [ dev ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node: [ '18' ] - name: Node ${{ matrix.node }} - steps: - - uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - name: Cache Node modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} - - name: Install Node dependencies & build assets - run: | - node -v - npm install - npm run build - - name: Run ESLint and Stylelint - run: npm run lint diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..ed54dea --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,11 @@ +name: Prepare Release ๐Ÿš€ + +on: + push: + branches: + - dev + +jobs: + deploy: + uses: pressbooks/reusable-workflows/.github/workflows/prepare-release.yml@main + secrets: inherit diff --git a/.github/workflows/ensure-npm-build.yml b/.github/workflows/ensure-npm-build.yml new file mode 100644 index 0000000..bf1cc3c --- /dev/null +++ b/.github/workflows/ensure-npm-build.yml @@ -0,0 +1,10 @@ +name: Npm build โš™๏ธ + +on: + pull_request: + branches: [ dev ] + +jobs: + update-npm-build: + if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' }} + uses: pressbooks/reusable-workflows/.github/workflows/npm-build.yml@main diff --git a/.github/workflows/standards-and-tests.yml b/.github/workflows/standards-and-tests.yml deleted file mode 100644 index 08b6df0..0000000 --- a/.github/workflows/standards-and-tests.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Run Standards & Tests - -on: - push: - branches: [ dev, master ] - tags: - - '*.*.*' - pull_request: - branches: [ dev ] - -jobs: - phpunit: - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: false - matrix: - php: [ 8.1, 8.2 ] - os: [ubuntu-20.04] - wordpress: ['6.5', latest] - include: - - experimental: true - - experimental: false - php: 8.1 - wordpress: '6.5' - name: Tests - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }} - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install OS dependencies - run: sudo systemctl start mysql.service - - - name: Cache Composer packages - uses: actions/cache@v3 - with: - path: vendor - key: ${{ matrix.php }}-php-${{ hashFiles('**/composer.lock') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer - coverage: pcov - - - name: Install PHP dependencies - run: | - export PATH="$HOME/.composer/vendor/bin:$PATH" - composer install --no-interaction - git clone --depth=1 https://github.com/pressbooks/pressbooks.git ../pressbooks - cd ../pressbooks && composer install --no-dev - cd ../excalibur - - - name: Run PHP CodeSniffer - run: composer standards - if: matrix.experimental == false - - - name: Install WP tests - run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress }} - - - name: Run PHP Tests - run: composer test - - - name: Prepare Build - if: startsWith(github.ref, 'refs/tags/') - run: | - export COMPOSER_MEMORY_LIMIT=-1 - export GITHUB_BUILD_PATH=${{github.workspace}} - export GITHUB_REPO_SLUG="$(basename ${{github.workspace}})" - export GITHUB_TAG="$(basename ${{github.ref}})" - echo "File to be created : $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip" - curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar - chmod +x wp-cli.phar - mv wp-cli.phar /usr/local/bin/wp - wp package install wp-cli/dist-archive-command - npm install - npm run build - composer install --no-dev --optimize-autoloader - cd .. - wp dist-archive $GITHUB_REPO_SLUG $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip - cd $GITHUB_BUILD_PATH - ls $GITHUB_BUILD_PATH - - - name: Deploy - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: - ${{github.workspace}}/*.zip - - - name: Trigger Bedrock Update - if: github.ref == 'refs/heads/dev' && matrix.experimental == false - uses: pressbooks/composer-autoupdate-bedrock@main - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_SNS_ARN_DEV: ${{ secrets.AWS_SNS_ARN_DEV }} - AWS_SNS_ARN_STAGING: ${{ secrets.AWS_SNS_ARN_STAGING }} - INPUT_TRIGGERED_BY: ${{ github.repository }} - BRANCH: ${{ github.ref }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..b685470 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: Run Tests ๐Ÿงช + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + workflow_dispatch: + +jobs: + plugin-tests: + uses: pressbooks/reusable-workflows/.github/workflows/pb-plugin-tests.yml@main + secrets: inherit + with: + requires_pressbooks: true + trigger_bedrock_updates: + needs: plugin-tests + runs-on: ubuntu-latest + steps: + - name: Trigger Bedrock Updates + if: github.ref == 'refs/heads/dev' + uses: pressbooks/composer-autoupdate-bedrock@main + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_SNS_ARN_DEV: ${{ secrets.AWS_SNS_ARN_DEV }} + AWS_SNS_ARN_STAGING: ${{ secrets.AWS_SNS_ARN_STAGING }} + INPUT_TRIGGERED_BY: ${{ github.repository }} + REF: ${{ github.ref }} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..9a2a0e2 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..64f3cdd --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.8.0" +} diff --git a/README.md b/README.md index 5be8308..aa789d6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ **Tags:** publishing, SWORD, libraries, repositories \ **Requires at least:** 6.5 \ **Tested up to:** 6.5 \ + **Stable tag:** 0.8.0 \ + **License:** GPLv3 or later, New BSD License \ **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -52,9 +54,5 @@ Or, download the latest version from the releases page and unzip it into your Wo yarn yarn production - -## Changelog - -### 0.8.0 -* See https://github.com/pressbooks/excalibur/releases/tag/0.8.0 -* Full release history at https://github.com/pressbooks/excalibur/releases/ +### Changelog +Please see the [CHANGELOG](CHANGELOG.md) file for more information. diff --git a/excalibur.php b/excalibur.php index 24eb91a..88798ca 100644 --- a/excalibur.php +++ b/excalibur.php @@ -1,20 +1,26 @@