Skip to content

Commit

Permalink
chore(*): Validate 2.4.7 and PHP 8.3 compatibility (#25)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
julienloizelet authored Apr 11, 2024
1 parent 8881320 commit ade2cde
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 47 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/end-to-end-auto-prepend-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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(') }}
Expand All @@ -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 }}
Expand All @@ -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 }}

Expand All @@ -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')
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/end-to-end-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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(') }}
Expand All @@ -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 }}
Expand All @@ -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 }}

Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/installation-and-varnish-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:

- name: Clone sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: extension

Expand Down
52 changes: 31 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/static-and-unit-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,15 +41,15 @@ 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 }}
composer_auth: ${{ secrets.M2_COMPOSER_AUTH }}
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 }}

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit ade2cde

Please sign in to comment.