feat: Add support for explicitly specifying release status (#78)

This commit is contained in:
Doug Keen
2021-09-21 07:57:13 -07:00
committed by GitHub
parent 9745ef904e
commit 060a2efa0e
5 changed files with 24 additions and 8 deletions

View File

@@ -48,6 +48,14 @@ _Values:_ `[0, 5]`
Portion of users who should get the staged version of the app. Accepts values between 0.0 and 1.0 (exclusive-exclusive). Omitting this value will execute a full rollout.
### `status`
Release status. This can be set to `draft` to complete the release at some other time.
**Default:** `inProgress` if `userFraction` is specified, otherwise `completed`
_Values:_ `completed`, `inProgress`, `draft`, `halted`
### `whatsNewDirectory`
The directory of localized whats new files to upload as the release notes. The files contained in the `whatsNewDirectory` MUST use the pattern `whatsnew-<LOCALE>` where `LOCALE` is using the [`BCP 47`](https://tools.ietf.org/html/bcp47) format, e.g.

View File

@@ -34,6 +34,9 @@ inputs:
userFraction:
description: "Portion of users who should get the staged version of the app. Accepts values between 0.0 and 1.0 (exclusive-exclusive)."
required: false
status:
description: "Release status. This can be set to 'draft' to complete the release at some other time."
required: false
whatsNewDirectory:
description: "The directory of localized whats new files"
required: false

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,7 @@ export interface EditOptions {
whatsNewDir?: string;
mappingFile?: string;
name?: string;
status?: string;
}
export async function uploadToPlayStore(options: EditOptions, releaseFiles: string[]): Promise<string | undefined> {
@@ -143,14 +144,16 @@ async function validateSelectedTrack(appEdit: AppEdit, options: EditOptions): Pr
}
async function addReleasesToTrack(appEdit: AppEdit, options: EditOptions, versionCodes: number[]): Promise<Track> {
let status: string;
if (options.userFraction != undefined) {
status = 'inProgress';
} else {
status = 'completed';
let status: string | undefined = options.status;
if (status == undefined) {
if (options.userFraction != undefined) {
status = 'inProgress';
} else {
status = 'completed';
}
}
core.debug(`Creating Track Release for Edit(${appEdit.id}) for Track(${options.track}) with a UserFraction(${options.userFraction}) and VersionCodes(${versionCodes})`);
core.debug(`Creating Track Release for Edit(${appEdit.id}) for Track(${options.track}) with a UserFraction(${options.userFraction}), Status(${status}), and VersionCodes(${versionCodes})`);
const res = await androidPublisher.edits.tracks
.update({
auth: options.auth,
@@ -254,4 +257,4 @@ async function uploadBundle(appEdit: AppEdit, options: EditOptions, bundleReleas
});
return res.data
}
}

View File

@@ -21,6 +21,7 @@ async function run() {
const track = core.getInput('track', { required: true });
const inAppUpdatePriority = core.getInput('inAppUpdatePriority', { required: false });
const userFraction = core.getInput('userFraction', { required: false });
const status = core.getInput('status', { required: false });
const whatsNewDir = core.getInput('whatsNewDirectory', { required: false });
const mappingFile = core.getInput('mappingFile', { required: false });
@@ -112,6 +113,7 @@ async function run() {
track: track,
inAppUpdatePriority: inAppUpdatePriorityInt || 0,
userFraction: userFractionFloat,
status: status,
whatsNewDir: whatsNewDir,
mappingFile: mappingFile,
name: releaseName