diff --git a/.github/conventional-commit-lint.yaml b/.github/conventional-commit-lint.yaml new file mode 100644 index 000000000..0c96b611f --- /dev/null +++ b/.github/conventional-commit-lint.yaml @@ -0,0 +1,2 @@ +always_check_pr_title: true + diff --git a/.github/workflows/asset-release.yml b/.github/workflows/asset-release.yml index 24a459254..6eb6c3792 100644 --- a/.github/workflows/asset-release.yml +++ b/.github/workflows/asset-release.yml @@ -1,10 +1,20 @@ name: Add Release Assets +permissions: + contents: write + on: release: types: [published] workflow_dispatch: - + inputs: + tag: + description: 'Tag to generate documentation for' + required: true + upload-on-workflow-dispatch: + description: 'Upload assets?' + required: false + default: "false" jobs: asset: runs-on: ${{ matrix.operating-system }} @@ -19,12 +29,6 @@ jobs: name: Get Tag run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Get release - id: get_release - uses: bruceadams/get-release@v1.2.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Checkout uses: actions/checkout@v2 @@ -51,14 +55,12 @@ jobs: zip -d ${fileName} "tests*" || true && zip -d ${fileName} "examples*" || true env: - fileName: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip + fileName: google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip - name: Upload Release Archive - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + uses: softprops/action-gh-release@v2 + if: github.ref_type == 'tag' || inputs.upload-on-workflow-dispatch == 'true' with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip - asset_name: google-api-php-client-${{ steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip - asset_content_type: application/zip + tag_name: ${{ inputs.tag || steps.tagName.outputs.tag }} + files: | + ./google-api-php-client-${{ inputs.tag || steps.tagName.outputs.tag }}-PHP${{ matrix.php }}.zip diff --git a/CHANGELOG.md b/CHANGELOG.md index a0418c111..8fc4cba90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.19.0](https://github.com/googleapis/google-api-php-client/compare/v2.18.4...v2.19.0) (2026-01-09) + + +### Features + +* Support firebase/php-jwt version 6.0 and 7.0 ([#2696](https://github.com/googleapis/google-api-php-client/issues/2696)) ([70ea42a](https://github.com/googleapis/google-api-php-client/commit/70ea42a6aa29a1321825c3dcda39cf39174390ea)) + + +### Bug Fixes + +* Upload assets release job ([#2671](https://github.com/googleapis/google-api-php-client/issues/2671)) ([0f56ea7](https://github.com/googleapis/google-api-php-client/commit/0f56ea773cb51cc6131c442d112d7fd630b49b5c)) + ## [2.18.4](https://github.com/googleapis/google-api-php-client/compare/v2.18.3...v2.18.4) (2025-09-29) diff --git a/composer.json b/composer.json index 240f9d1c8..22d8c4f96 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": "^8.1", "google/auth": "^1.37", "google/apiclient-services": "~0.350", - "firebase/php-jwt": "^6.0", + "firebase/php-jwt": "^6.0||^7.0", "monolog/monolog": "^2.9||^3.0", "phpseclib/phpseclib": "^3.0.36", "guzzlehttp/guzzle": "^7.4.5", diff --git a/docs/oauth-web.md b/docs/oauth-web.md index 18bc5e32b..7d21b5620 100644 --- a/docs/oauth-web.md +++ b/docs/oauth-web.md @@ -258,10 +258,10 @@ After completing the OAuth 2.0 flow, you should be redirected to `http://localho After the web server receives the authorization code, it can exchange the authorization code for an access token. -To exchange an authorization code for an access token, use the `authenticate` method: +To exchange an authorization code for an access token, use the `fetchAccessTokenWithAuthCode` method: ```php -$client->authenticate($_GET['code']); +$client->fetchAccessTokenWithAuthCode($_GET['code']); ``` You can retrieve the access token with the `getAccessToken` method: @@ -361,7 +361,7 @@ if (! isset($_GET['code'])) { $auth_url = $client->createAuthUrl(); header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); } else { - $client->authenticate($_GET['code']); + $client->fetchAccessTokenWithAuthCode($_GET['code']); $_SESSION['access_token'] = $client->getAccessToken(); $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/'; header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); diff --git a/src/Http/REST.php b/src/Http/REST.php index c3d3270db..ea6eb668b 100644 --- a/src/Http/REST.php +++ b/src/Http/REST.php @@ -89,19 +89,6 @@ public static function doExecute(ClientInterface $client, RequestInterface $requ } $response = $e->getResponse(); - // specific checking for Guzzle 5: convert to PSR7 response - if ( - interface_exists('\GuzzleHttp\Message\ResponseInterface') - && $response instanceof \GuzzleHttp\Message\ResponseInterface - ) { - $response = new Response( - $response->getStatusCode(), - $response->getHeaders() ?: [], - $response->getBody(), - $response->getProtocolVersion(), - $response->getReasonPhrase() - ); - } } return self::decodeHttpResponse($response, $request, $expectedClass); diff --git a/tests/Google/Http/RESTTest.php b/tests/Google/Http/RESTTest.php index ef44ed0a2..7b05b0cb4 100644 --- a/tests/Google/Http/RESTTest.php +++ b/tests/Google/Http/RESTTest.php @@ -31,6 +31,7 @@ class RESTTest extends BaseTest * @var REST $rest */ private $rest; + private Request $request; public function setUp(): void {