@zuke/google
`@zuke/google` — Google Play publishing for Zuke builds, through the Google
@zuke/google on JSR ↗ 7 symbols
Symbols
const GOOGLE_PLAY_API_URL: https://androidpublisher.googleapis.com The Google Play Developer API's base URL.
class GooglePlayError extends Error Raised by GooglePlayTasks.upload. The message names the step and, for a refused request, Google's own error message; it never carries the service-account key or an access token.
| Member | Signature | Doc |
|---|---|---|
name | name: string | The error name. |
type GooglePlayReleaseStatus = completed | draft A release's status on its track. completed makes it live for the track's testers or users; draft saves it to publish from the Play Console — the only status Google accepts for an app that has never had a release.
class GooglePlaySettings Settings for GooglePlayTasks.upload.
The service-account key and every token signed with it stay out of progress lines and errors. Declare the key in the build as parameter(...).secret() so Zuke masks it in its own output too.
| Member | Signature | Doc |
|---|---|---|
serviceAccount | serviceAccount(json: string): this | The service account's key, as the text of the JSON file the Play Console (or Google Cloud) downloaded; required. The account needs the *Release apps to testing tracks* (or *Release to production*) permission on the app. |
packageName | packageName(name: string): this | The app's package name, e.g. com.example.app; required. |
bundle | bundle(path: PathLike): this | The Android app bundle (.aab) to upload; required. |
track | track(name: string): this | The track to release on: internal (the default), alpha, beta, production, or the name of a closed testing track. |
status | status(status: GooglePlayReleaseStatus): this | The release's status; default completed. |
releaseNotes | releaseNotes(text: string, language?: string): this | The release notes users see, per BCP-47 language ("en-US", "bg"); repeatable, one call per language. Default language en-US. |
changesNotSentForReview | changesNotSentForReview(): this | Commit without sending the changes for review, so an app with managed publishing or a release that review would otherwise hold can go out as Google allows it to. |
timeout | timeout(duration: string | number): this | The longest the whole upload may take ("30m", or ms); default 15 minutes. |
apiUrl | apiUrl(url: string): this | The API's base URL, https://androidpublisher.googleapis.com by default. It carries the access token, so it must be https: unless it is loopback or ZUKE_ALLOW_INSECURE_URL is set. |
fetch | fetch(fetcher: fetch): this | Send with this fetch instead of the global one — the seam tests use. |
readEnv | readEnv(reader: unknown): this | Read environment variables through reader instead of Deno.env. |
now | now(clock: unknown): this | Read the time from clock (epoch ms) instead of Date.now. |
log | log(sink: unknown): this | Send progress lines to sink instead of console.log. |
serviceAccount_? | serviceAccount_?: string | The service-account key's JSON text (set by serviceAccount). |
packageName_? | packageName_?: string | The app's package name (set by packageName). |
bundle_? | bundle_?: string | The app bundle's path (set by bundle). |
track_ | track_: string | The track (set by track). |
status_ | status_: GooglePlayReleaseStatus | The release status (set by status). |
releaseNotes_ | releaseNotes_: Map<string, string> | Release notes by language (set by releaseNotes). |
changesNotSentForReview_ | changesNotSentForReview_: boolean | Whether the commit skips review (set by changesNotSentForReview). |
timeout_ | timeout_: number | The longest the whole upload may take, in ms (set by timeout). |
apiUrl_ | apiUrl_: string | The API's base URL (set by apiUrl). |
fetch_ | fetch_: fetch | The fetch to use (set by fetch). |
readEnv_ | readEnv_: unknown | The environment reader (set by readEnv). |
now_ | now_: unknown | The clock, in epoch ms (set by now). |
log_ | log_: unknown | Where progress lines go (set by log). |
const GooglePlayTasks: GooglePlayTasksApi Publish to Google Play through the Google Play Developer API.
interface GooglePlayTasksApi The shape of GooglePlayTasks.
| Member | Signature | Doc |
|---|---|---|
upload | upload(configure: Configure<GooglePlaySettings>): Promise<GooglePlayUpload> | Upload an app bundle and release it on a track, in one committed edit. |
interface GooglePlayUpload What GooglePlayTasks.upload released.
| Member | Signature | Doc |
|---|---|---|
packageName | packageName: string | The app's package name. |
versionCode | versionCode: number | The uploaded bundle's version code, as Google Play read it. |
track | track: string | The track the release went to. |
status | status: GooglePlayReleaseStatus | The release's status. |