Skip to content

chore: update libver and add release test #2672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

8 changes: 6 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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.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';
Expand All @@ -64,7 +68,7 @@ class Client
*/
private $auth;

/**
**
* @var ClientInterface $http
*/
private $http;
Expand Down
Loading