Skip to content
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 Google\Client::LIBVER
steps:

- 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);echo $matches[1];')
if [ "$LIBVER" != "$RELEASEVER" ]; then
echo "Google\Client::LIBVER ($LIBVER) does not equal the current release ($RELEASEVER)."
exit 1
fi

6 changes: 5 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
*/
class Client
{
const LIBVER = "2.12.6";
// Release Please updates the VERSION constant. This workaround ensures the LIBVER constant
// will be updated for each release as well.
private const VERSION = '2.19.1';
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';
Expand Down
Loading