From 2d2f64cd87d84a1023914a32b0aab55ce927c39a Mon Sep 17 00:00:00 2001 From: Julien Loizelet Date: Fri, 4 Oct 2024 11:15:05 +0900 Subject: [PATCH] feat(*): Bump version --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/doc-links.yml | 4 +- .github/workflows/release.yml | 41 ++++++------------- .../workflows/unit-and-integration-test.yml | 2 +- CHANGELOG.md | 7 ++-- docs/USER_GUIDE.md | 2 +- src/Constants.php | 2 +- 7 files changed, 22 insertions(+), 38 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index d47e737..c615112 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -63,7 +63,7 @@ jobs: ddev exec php -v - name: Clone sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{env.EXTENSION_PATH}} diff --git a/.github/workflows/doc-links.yml b/.github/workflows/doc-links.yml index b559187..798a53a 100644 --- a/.github/workflows/doc-links.yml +++ b/.github/workflows/doc-links.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Clone sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: extension @@ -37,4 +37,4 @@ jobs: gem install awesome_bot cd extension awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/ - awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401 --white-list crowdsec.net/v2,ddev.site,https://crowdsec,your-crowdsec-lapi-url --base-url http://localhost:8080/docs/ + awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401,301 --white-list crowdsec.net/v2,ddev.site,https://crowdsec,http://crowdsec,http://localhost:7422,your-crowdsec-lapi-url,your-crowdsec-app-sec-url --base-url http://localhost:8080/docs/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86e73a7..4ed7743 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ name: Create 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: branches: @@ -8,18 +8,6 @@ on: tag_name: type: string required: true - draft: - type: boolean - description: Draft release - default: false - prerelease: - type: boolean - description: Prerelease - default: false - first-release: - type: boolean - description: First release - default: false jobs: prepare-release: @@ -43,7 +31,7 @@ jobs: echo "VERSION_NUMBER=$(echo ${{ github.event.inputs.tag_name }} | sed 's/v//g' )" >> $GITHUB_ENV - name: Clone sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check version ${{ env.VERSION_NUMBER }} consistency in files # Check src/Constants.php and CHANGELOG.md @@ -72,23 +60,20 @@ jobs: fi # Check top [_Compare with previous release_](GITHUB_URL/compare/vLAST_TAG...vVERSION_NUMBER) in CHANGELOG.md - if [[ ${{ github.event.inputs.first-release }} != "true" ]] + COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1) + LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$") + if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]] then - COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1) - LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$") - if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]] - then - echo "VERSION COMPARISON OK" - else - echo "VERSION COMPARISON KO" - echo $COMPARISON - echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})" - exit 1 - fi + echo "VERSION COMPARISON OK" + else + echo "VERSION COMPARISON KO" + echo $COMPARISON + echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})" + exit 1 fi - name: Create Tag ${{ github.event.inputs.tag_name }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ github.token }} script: | @@ -106,7 +91,7 @@ jobs: echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt - name: Create release ${{ env.VERSION_NUMBER }} - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: body_path: CHANGELOG.txt name: ${{ env.VERSION_NUMBER }} diff --git a/.github/workflows/unit-and-integration-test.yml b/.github/workflows/unit-and-integration-test.yml index 25cc694..5706b87 100644 --- a/.github/workflows/unit-and-integration-test.yml +++ b/.github/workflows/unit-and-integration-test.yml @@ -110,7 +110,7 @@ jobs: if: | github.event.inputs.integration_tests == 'true' || github.event_name == 'push' - run: ddev exec AGENT_TLS_PATH=/var/www/html/cfssl BOUNCER_TLS_PATH=/var/www/html/cfssl APPSEC_URL=http://crowdsec:7422 LAPI_URL=https://crowdsec:8080 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group timeout ./${{env.EXTENSION_PATH}}/tests/Integration + run: ddev exec BOUNCER_KEY=${{ env.BOUNCER_KEY }} AGENT_TLS_PATH=/var/www/html/cfssl BOUNCER_TLS_PATH=/var/www/html/cfssl APPSEC_URL=http://crowdsec:7422 LAPI_URL=https://crowdsec:8080 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group timeout ./${{env.EXTENSION_PATH}}/tests/Integration - name: Run Integration tests with timeout if: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 644b07c..aa2a289 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,20 +13,19 @@ As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com --- -## [3.3.0](https://github.com/crowdsecurity/php-lapi-client/releases/tag/v3.3.0) - 2024-??-?? -[_Compare with previous release_](https://github.com/crowdsecurity/php-lapi-client/compare/v3.2.0...HEAD) +## [3.3.0](https://github.com/crowdsecurity/php-lapi-client/releases/tag/v3.3.0) - 2024-10-04 +[_Compare with previous release_](https://github.com/crowdsecurity/php-lapi-client/compare/v3.2.0...v3.3.0) ### Added - Add `getAppSecDecision` method to `Bouncer` class -- Add `appsec_url`, 'appsec_timeout' and `appsec_connect_timeout` configuration +- Add `appsec_url`, `appsec_timeout_ms` and `appsec_connect_timeout_ms` configurations ### Changed - Throws a `CrowdSec\LapiClient\TimeoutException` when a timeout is detected during client calls - --- ## [3.2.0](https://github.com/crowdsecurity/php-lapi-client/releases/tag/v3.2.0) - 2023-12-07 diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index aa851f1..f3d52b8 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -149,7 +149,7 @@ The `$headers` parameter is an array containing the headers of the forwarded req The `$rawBody` parameter is optional and must be used if the forwarded request contains a body. It must be a string. -Please see the [CrowdSec AppSec documentation](https://docs.crowdsec.net/docs/appsec/intro) for more details. +Please see the [CrowdSec AppSec documentation](https://docs.crowdsec.net/docs/appsec/intro/) for more details. ## Bouncer client configurations diff --git a/src/Constants.php b/src/Constants.php index 3020e81..11b663d 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -41,5 +41,5 @@ class Constants extends CommonConstants /** * @var string The current version of this library */ - public const VERSION = 'v3.2.0'; + public const VERSION = 'v3.3.0'; }