From 02dac03fc097f11bb5cd7d51c1e0371538c7c3db Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 11:43:49 -0700 Subject: [PATCH 1/9] chore: update libver --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index edfb1f83e..92c540c37 100644 --- a/src/Client.php +++ b/src/Client.php @@ -52,7 +52,7 @@ */ class Client { - const LIBVER = "2.12.6"; + const LIBVER = "2.18.3"; const USER_AGENT_SUFFIX = "google-api-php-client/"; const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke'; const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token'; From d48ee797f83e53993d984dae804e4f6d4760c1b1 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:00:26 -0700 Subject: [PATCH 2/9] Revert "chore: update libver" for testing This reverts commit 02dac03fc097f11bb5cd7d51c1e0371538c7c3db. --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 92c540c37..edfb1f83e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -52,7 +52,7 @@ */ class Client { - const LIBVER = "2.18.3"; + const LIBVER = "2.12.6"; const USER_AGENT_SUFFIX = "google-api-php-client/"; const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke'; const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token'; From 6231d49064698e5976f57ad5006f96637ea9939e Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:01:24 -0700 Subject: [PATCH 3/9] add release test to ensure libver is uptodate --- .github/workflows/tests.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f86e493a..5abe824ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -65,4 +65,22 @@ jobs: composer install composer global require phpstan/phpstan ~/.composer/vendor/bin/phpstan analyse + libver-check: + runs-on: ubuntu-latest + name: verify libver verison + #if: github.event.pull_request.user.login == 'release-please[bot]' + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + - name: Verify libver + # @TODO change version to be "dev-main" before we merge + run: | + LIBVER=$(php -r "require 'src/Client.php'; echo Google\Client::LIBVER;") + RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);var_dump($matches[1]);') + if [ "$LIBVER" != "$RELEASEVER" ]; then + echo "Google\Client::LIBVER ($LIBVER)does not equal the current release ($RELEASEVER). Be sure to update it." + exit 1 + fi From 824bc2335598d6b5a2f18ced8c77de79b9fc29fb Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:04:18 -0700 Subject: [PATCH 4/9] add checkout --- .github/workflows/tests.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5abe824ca..2a982cfa6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,20 +67,20 @@ jobs: ~/.composer/vendor/bin/phpstan analyse libver-check: runs-on: ubuntu-latest - name: verify libver verison - #if: github.event.pull_request.user.login == 'release-please[bot]' + name: Verify Google\Client::LIBVER steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - name: Verify libver - # @TODO change version to be "dev-main" before we merge - run: | - LIBVER=$(php -r "require 'src/Client.php'; echo Google\Client::LIBVER;") - RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);var_dump($matches[1]);') - if [ "$LIBVER" != "$RELEASEVER" ]; then - echo "Google\Client::LIBVER ($LIBVER)does not equal the current release ($RELEASEVER). Be sure to update it." - exit 1 - fi + + - uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + - name: Verify libver + run: | + LIBVER=$(php -r 'require "src/Client.php"; echo Google\Client::LIBVER;') + RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);var_dump($matches[1]);') + if [ "$LIBVER" != "$RELEASEVER" ]; then + echo "Google\Client::LIBVER ($LIBVER) does not equal the current release ($RELEASEVER). Be sure to update it." + exit 1 + fi From bc396764c445f501b9ea82ff926a0d2f1a3ff948 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:05:31 -0700 Subject: [PATCH 5/9] fix releasever output --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2a982cfa6..1aa809f1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,7 @@ jobs: - name: Verify libver run: | LIBVER=$(php -r 'require "src/Client.php"; echo Google\Client::LIBVER;') - RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);var_dump($matches[1]);') + RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);echo $matches[1];') if [ "$LIBVER" != "$RELEASEVER" ]; then echo "Google\Client::LIBVER ($LIBVER) does not equal the current release ($RELEASEVER). Be sure to update it." exit 1 From a02ffac6667e627a5d90c567bd14bf9575ff8d2b Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:07:30 -0700 Subject: [PATCH 6/9] Reapply "chore: update libver" for testing This reverts commit d48ee797f83e53993d984dae804e4f6d4760c1b1. --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index edfb1f83e..92c540c37 100644 --- a/src/Client.php +++ b/src/Client.php @@ -52,7 +52,7 @@ */ class Client { - const LIBVER = "2.12.6"; + const LIBVER = "2.18.3"; const USER_AGENT_SUFFIX = "google-api-php-client/"; const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke'; const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token'; From 974ef26da8fb0dfbf3f7cb119baea593710ec1b9 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:08:00 -0700 Subject: [PATCH 7/9] nit: more concise error --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1aa809f1c..69910a434 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -80,7 +80,7 @@ jobs: LIBVER=$(php -r 'require "src/Client.php"; echo Google\Client::LIBVER;') RELEASEVER=$(php -r 'preg_match("/## \[(\d.\d+.\d+)\]\(/", file_get_contents("CHANGELOG.md"), $matches);echo $matches[1];') if [ "$LIBVER" != "$RELEASEVER" ]; then - echo "Google\Client::LIBVER ($LIBVER) does not equal the current release ($RELEASEVER). Be sure to update it." + echo "Google\Client::LIBVER ($LIBVER) does not equal the current release ($RELEASEVER)." exit 1 fi From 8841e9e1a1c18a748e281aa2e518d55aff432356 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:16:28 -0700 Subject: [PATCH 8/9] ensure libver is updated by releaseplease --- src/Client.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 92c540c37..e973f13a2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -52,7 +52,11 @@ */ class Client { - const LIBVER = "2.18.3"; + // Release Please updates the VERSION constant. This workaround ensures the LIBVER constant + // will be updated for each release. + private const VERSION = '2.18.3'; + const LIBVER = self::VERSION; + const USER_AGENT_SUFFIX = "google-api-php-client/"; const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke'; const OAUTH2_TOKEN_URI = 'https://oauth2.googleapis.com/token'; From ae2d774de55384be19a2e1a3f2668249a880fcf8 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 7 May 2025 12:17:17 -0700 Subject: [PATCH 9/9] docs --- src/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index e973f13a2..cd220cbd4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -53,7 +53,7 @@ class Client { // Release Please updates the VERSION constant. This workaround ensures the LIBVER constant - // will be updated for each release. + // will be updated for each release as well. private const VERSION = '2.18.3'; const LIBVER = self::VERSION; @@ -68,7 +68,7 @@ class Client */ private $auth; - /** + ** * @var ClientInterface $http */ private $http;