feat: Add support for explicitly specifying release status (#78)
This commit is contained in:
17
src/edits.ts
17
src/edits.ts
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user