From ade2cde4507e72ef21b68fb0351d13f3c15881d8 Mon Sep 17 00:00:00 2001 From: Julien Loizelet Date: Thu, 11 Apr 2024 18:33:29 +0900 Subject: [PATCH] chore(*): Validate 2.4.7 and PHP 8.3 compatibility (#25) * ci(*): Add 2.4.7 and PHP 8.3 in action matrixes * chore(*): Prepare release 2.1.1 * ci(release): Modify release process to allow creating only zip for marketplace --- .../end-to-end-auto-prepend-test-suite.yml | 15 +++--- .github/workflows/end-to-end-test-suite.yml | 12 ++--- .../installation-and-varnish-test-suite.yml | 12 ++--- .github/workflows/markdown.yml | 2 +- .github/workflows/release.yml | 52 +++++++++++-------- .../workflows/static-and-unit-test-suite.yml | 8 +-- CHANGELOG.md | 10 ++++ Constants.php | 2 +- composer.json | 2 +- 9 files changed, 68 insertions(+), 47 deletions(-) diff --git a/.github/workflows/end-to-end-auto-prepend-test-suite.yml b/.github/workflows/end-to-end-auto-prepend-test-suite.yml index 0b1e5d1..18f94a4 100644 --- a/.github/workflows/end-to-end-auto-prepend-test-suite.yml +++ b/.github/workflows/end-to-end-auto-prepend-test-suite.yml @@ -23,10 +23,10 @@ jobs: include: - m2-version: '2.3.7' php-version: '7.4' - - m2-version: '2.4.5' - php-version: '8.1' - m2-version: '2.4.6' php-version: '8.2' + - m2-version: '2.4.7' + php-version: '8.3' name: End-to-end auto-prepend-file mode test suite if: ${{ !contains(github.event.head_commit.message, 'chore(') }} @@ -39,7 +39,7 @@ jobs: steps: - name: Install Magento 2 with DDEV - uses: julienloizelet/magento2-ddev-installation@v2.1.1 + uses: julienloizelet/magento2-ddev-installation@v3 with: php_version: ${{ matrix.php-version }} magento_version: ${{ matrix.m2-version }} @@ -57,7 +57,7 @@ jobs: run: ddev get julienloizelet/ddev-playwright - name: Clone M2 ${{ env.EXTENSION_NAME }} files - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: my-own-modules/${{ env.EXTENSION_PATH }} @@ -72,9 +72,10 @@ jobs: run: | ddev composer require ${{ env.EXTENSION_PACKAGE_NAME }}:@dev --no-interaction - - name: Disable some extensions for 2.4.6 - if: startsWith(matrix.m2-version, '2.4.6') - run: ddev magento module:disable Magento_AdminAdobeImsTwoFactorAuth + - name: Disable some extensions for 2.4.6 and superior + if: contains(fromJson('["2.4.6", "2.4.7"]'),matrix.m2-version) + run: | + ddev magento module:disable Magento_AdminAdobeImsTwoFactorAuth - name: Disable some extensions for 2.4 if: startsWith(matrix.m2-version, '2.4') diff --git a/.github/workflows/end-to-end-test-suite.yml b/.github/workflows/end-to-end-test-suite.yml index cacc7a9..4de0362 100644 --- a/.github/workflows/end-to-end-test-suite.yml +++ b/.github/workflows/end-to-end-test-suite.yml @@ -28,10 +28,10 @@ jobs: include: - m2-version: '2.3.7' php-version: '7.4' - - m2-version: '2.4.5' - php-version: '8.1' - m2-version: '2.4.6' php-version: '8.2' + - m2-version: '2.4.7' + php-version: '8.3' name: End-to-end test suite if: ${{ !contains(github.event.head_commit.message, 'chore(') }} @@ -44,7 +44,7 @@ jobs: steps: - name: Install Magento 2 with DDEV - uses: julienloizelet/magento2-ddev-installation@v2.1.1 + uses: julienloizelet/magento2-ddev-installation@v3 with: php_version: ${{ matrix.php-version }} magento_version: ${{ matrix.m2-version }} @@ -62,7 +62,7 @@ jobs: run: ddev get julienloizelet/ddev-playwright - name: Clone M2 ${{ env.EXTENSION_NAME }} files - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: my-own-modules/${{ env.EXTENSION_PATH }} @@ -79,8 +79,8 @@ jobs: run: | ddev composer require ${{ env.EXTENSION_PACKAGE_NAME }}:@dev --no-interaction - - name: Disable some extensions for 2.4.6 - if: startsWith(matrix.m2-version, '2.4.6') + - name: Disable some extensions for 2.4.6 and superior + if: contains(fromJson('["2.4.6", "2.4.7"]'),matrix.m2-version) run: | ddev magento module:disable Magento_AdminAdobeImsTwoFactorAuth diff --git a/.github/workflows/installation-and-varnish-test-suite.yml b/.github/workflows/installation-and-varnish-test-suite.yml index d357218..4d81f8e 100644 --- a/.github/workflows/installation-and-varnish-test-suite.yml +++ b/.github/workflows/installation-and-varnish-test-suite.yml @@ -28,8 +28,8 @@ jobs: include: - m2-version: '2.3.7' php-version: '7.4' - - m2-version: '2.4.6' - php-version: '8.2' + - m2-version: '2.4.7' + php-version: '8.3' name: Installation and Varnish test suite # @see https://devdocs.magento.com/marketplace/sellers/installation-and-varnish-tests.html @@ -42,7 +42,7 @@ jobs: steps: - name: Install Magento 2 with DDEV - uses: julienloizelet/magento2-ddev-installation@v2.1.1 + uses: julienloizelet/magento2-ddev-installation@v3 id: magento2-install with: php_version: ${{ matrix.php-version }} @@ -52,7 +52,7 @@ jobs: varnish_setup: "true" - name: Clone M2 ${{ env.EXTENSION_NAME }} files - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: my-own-modules/${{ env.EXTENSION_PATH }} @@ -80,8 +80,8 @@ jobs: ddev magento config:set system/full_page_cache/caching_application 2 ddev magento setup:performance:generate-fixtures ./varnish-profile.xml - - name: Disable some extensions for 2.4.6 - if: startsWith(matrix.m2-version, '2.4.6') + - name: Disable some extensions for 2.4.7 + if: startsWith(matrix.m2-version, '2.4.7') run: | ddev magento maintenance:enable ddev magento module:disable --clear-static-content Magento_AdminAdobeImsTwoFactorAuth diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 37f4bf5..6b4523e 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Clone sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: extension diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a716c99..6bbcaf4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,18 @@ name: Release -# example: gh workflow run release.yml -f tag_name=v1.1.4 -f draft=true +# example: gh workflow run release.yml -f tag_name=v1.1.4 on: workflow_dispatch: inputs: tag_name: type: string + description: Tag name required: true - draft: + only_zip_for_marketplace: type: boolean - description: Draft release - default: false - prerelease: - type: boolean - description: Prerelease - default: false + description: Only create zip for marketplace + required: true + default: true + env: # Allow ddev get to use a GitHub token to prevent rate limiting by tests @@ -47,7 +46,7 @@ jobs: echo "VERSION_SOURCES=$(echo ${{ env.EXTENSION_ZIP_NAME }}-${{ env.VERSION_NUMBER }} )" >> $GITHUB_ENV - name: Clone sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.VERSION_SOURCES }} @@ -99,7 +98,7 @@ jobs: zip -r ${{ env.VERSION_SOURCES }}.zip ${{ env.VERSION_SOURCES }}/ -x '${{ env.VERSION_SOURCES }}/.git*' - name: Clone zip validator - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: julienloizelet/m2-extension-zip-validator path: zip-validator @@ -110,7 +109,8 @@ jobs: php zip-validator/validate_m2_package.php ${{ env.VERSION_SOURCES }}.zip - name: Create Tag ${{ github.event.inputs.tag_name }} - uses: actions/github-script@v6 + if: github.event.inputs.only_zip_for_marketplace != 'true' + uses: actions/github-script@v7 with: github-token: ${{ github.token }} script: | @@ -122,19 +122,29 @@ jobs: }) - name: Prepare release notes + if: github.event.inputs.only_zip_for_marketplace != 'true' run: | VERSION_RELEASE_NOTES=$(awk -v ver="[${{ env.VERSION_NUMBER }}]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/v${{ env.VERSION_NUMBER }})" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next} } p && NF' ${{ env.VERSION_SOURCES }}/CHANGELOG.md | sed ':a;N;$!ba;s/\n---/ /g') echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt - name: Create release ${{ env.VERSION_NUMBER }} - uses: softprops/action-gh-release@v1 + if: github.event.inputs.only_zip_for_marketplace != 'true' + uses: softprops/action-gh-release@v2 with: files: ${{ env.VERSION_SOURCES }}.zip body_path: CHANGELOG.txt name: ${{ env.VERSION_NUMBER }} tag_name: ${{ github.event.inputs.tag_name }} - draft: ${{ github.event.inputs.draft }} - prerelease: ${{ github.event.inputs.prerelease }} + draft: false + prerelease: false + + - name: Save zip + if: github.event.inputs.only_zip_for_marketplace == 'true' + uses: actions/upload-artifact@v4 + with: + name: ${{ env.VERSION_SOURCES }}.zip + path: ${{ env.VERSION_SOURCES }}.zip + retention-days: 60 after-release: @@ -145,13 +155,13 @@ jobs: include: - m2-version: '2.3.7' php-version: '7.4' - - m2-version: '2.4.5' - php-version: '8.1' - m2-version: '2.4.6' php-version: '8.2' + - m2-version: '2.4.7' + php-version: '8.3' name: After release test suite - if: success() + if: success() && github.event.inputs.only_zip_for_marketplace != 'true' needs: [ create-release ] runs-on: ubuntu-latest env: @@ -162,7 +172,7 @@ jobs: steps: - name: Install Magento 2 with DDEV - uses: julienloizelet/magento2-ddev-installation@v2.1.1 + uses: julienloizelet/magento2-ddev-installation@v3 with: php_version: ${{ matrix.php-version }} magento_version: ${{ matrix.m2-version }} @@ -180,7 +190,7 @@ jobs: run: ddev get julienloizelet/ddev-playwright - name: Clone M2 ${{ env.EXTENSION_NAME }} files - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: module-sources @@ -208,8 +218,8 @@ jobs: run: | ddev composer require ${{ env.EXTENSION_PACKAGE_NAME }}:@dev --no-interaction - - name: Disable some extensions for 2.4.6 - if: startsWith(matrix.m2-version, '2.4.6') + - name: Disable some extensions for 2.4.6 and superior + if: contains(fromJson('["2.4.6", "2.4.7"]'),matrix.m2-version) run: | ddev magento module:disable Magento_AdminAdobeImsTwoFactorAuth diff --git a/.github/workflows/static-and-unit-test-suite.yml b/.github/workflows/static-and-unit-test-suite.yml index 2d98cc7..001b567 100644 --- a/.github/workflows/static-and-unit-test-suite.yml +++ b/.github/workflows/static-and-unit-test-suite.yml @@ -29,8 +29,8 @@ jobs: php-version: '7.4' - m2-version: '2.4.0' php-version: '7.4' - - m2-version: '2.4.6' - php-version: '8.2' + - m2-version: '2.4.7' + php-version: '8.3' name: Static and unit test suite runs-on: ubuntu-latest @@ -41,7 +41,7 @@ jobs: steps: - name: Install Magento 2 with DDEV - uses: julienloizelet/magento2-ddev-installation@v2.1.1 + uses: julienloizelet/magento2-ddev-installation@v3 with: php_version: ${{ matrix.php-version }} magento_version: ${{ matrix.m2-version }} @@ -49,7 +49,7 @@ jobs: magento_repository: "https://repo.magento.com/" - name: Clone M2 Crowdsec Bouncer files - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: my-own-modules/${{ env.EXTENSION_PATH }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae399a..8a81b54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ The [public API](https://semver.org/spec/v2.0.0.html#spec-item-1) for this proje functions provided by the module. + +## [2.1.1](https://github.com/crowdsecurity/cs-magento-bouncer/releases/tag/v2.1.1) - 2024-04-12 +[_Compare with previous release_](https://github.com/crowdsecurity/cs-magento-bouncer/compare/v2.1.0...v2.1.1) + + +- Release for Magento 2.4.7 and PHP 8.3 compatibility + + +--- + ## [2.1.0](https://github.com/crowdsecurity/cs-magento-bouncer/releases/tag/v2.1.0) - 2024-01-05 [_Compare with previous release_](https://github.com/crowdsecurity/cs-magento-bouncer/compare/v2.0.0...v2.1.0) diff --git a/Constants.php b/Constants.php index 28bee29..d06e8e4 100644 --- a/Constants.php +++ b/Constants.php @@ -33,7 +33,7 @@ class Constants extends LibConstants { /** @var string The last version of this library */ - public const VERSION = 'v2.1.0'; + public const VERSION = 'v2.1.1'; /** @var string The user agent used to send request to Local API */ public const BASE_USER_AGENT = 'Magento 2 CrowdSec Bouncer/'.self::VERSION; diff --git a/composer.json b/composer.json index a811c3f..75d73e7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "crowdsec/magento2-module-bouncer", "description": "The Bouncer module for Magento 2 allows rejecting IP detected as malicious by CrowdSec", "type": "magento2-module", - "version": "2.1.0", + "version": "2.1.1", "minimum-stability": "stable", "license": "MIT", "authors": [