From 207fcf5ed987247f1e8621ead95e349af2010747 Mon Sep 17 00:00:00 2001 From: Jonathan Romano Date: Fri, 6 Sep 2024 17:03:11 -0400 Subject: [PATCH] Debug --- .github/workflows/google-play/src/index.js | 1 + .github/workflows/google-play/src/play-store-api.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/google-play/src/index.js b/.github/workflows/google-play/src/index.js index f134124..e128648 100644 --- a/.github/workflows/google-play/src/index.js +++ b/.github/workflows/google-play/src/index.js @@ -7,6 +7,7 @@ const PACKAGE_NAME = 'org.eternagame.mob'; const args = parseArgs(); const playStoreApi = await PlayStoreApi.create(args.apiKey); if (args.mode === 'upload') { + console.log('Starting Upload') const editId = await playStoreApi.insertEdit(PACKAGE_NAME); await playStoreApi.uploadBundle(PACKAGE_NAME, editId, args.bundlePath); await playStoreApi.commitEdit(PACKAGE_NAME, editId); diff --git a/.github/workflows/google-play/src/play-store-api.js b/.github/workflows/google-play/src/play-store-api.js index f44d7fd..1da6e02 100644 --- a/.github/workflows/google-play/src/play-store-api.js +++ b/.github/workflows/google-play/src/play-store-api.js @@ -43,6 +43,9 @@ export class PlayStoreApi { assertion: authToken }).toString() }); + if (res.status === 400) { + console.log('Access token status', res.status, res.statusText, await res.json()) + } const parsed = await res.json(); return new PlayStoreApi(parsed['access_token']); } @@ -81,11 +84,12 @@ export class PlayStoreApi { } async commitEdit(packageName, editId) { - await fetch(`https://androidpublisher.googleapis.com/androidpublisher/v3/applications/${packageName}/edits/${editId}:commit`, { + const res = await fetch(`https://androidpublisher.googleapis.com/androidpublisher/v3/applications/${packageName}/edits/${editId}:commit`, { method: 'POST', headers: { Authorization: `Bearer ${this.accessToken}`, }, }); + console.log('Commit response', res.status, res.statusText) } } \ No newline at end of file