Skip to content

Commit

Permalink
fix: Bring back the default release status (r0adkll#154)
Browse files Browse the repository at this point in the history
* Bring back the default release status

* Create a test for the bare minimum inputs
  • Loading branch information
boswelja authored Nov 3, 2022
1 parent 78c9e79 commit d7e6e42
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This action will help you upload an Android `.apk` or `.aab` (Android App Bundle
| releaseName | The release name. Not required to be unique. Default is configured by Google Play Console | A user-friendly update name, e.g. `v1.0.0` | false |
| inAppUpdatePriority | In-app update priority of the release. All newly added APKs in the release will be considered at this priority. Defaults to `0` | `[0-5]`, where `5` is the highest priority | false |
| userFraction | Percentage of users who should get the staged version of the app. Defaults to `1.0` | `[0.0-1.0]` | true |
| status | Release status. Defaults to `completed` if targeting 100% rollout, `halted` for 0%, and `inProgress` for anything in between | One of `completed`, `inProgress`, `halted`, `draft` | false |
| status | Release status. Defaults to `completed` if targeting 100% rollout, `halted` for 0%, and `inProgress` for anything in between. Defaults to `completed` | One of `completed`, `inProgress`, `halted`, `draft` | true |
| 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 | A path to a valid `whatsNewDirectory` | false |
| mappingFile | The mapping.txt file used to de-obfuscate your stack traces from crash reports | A path to a valid `mapping.txt` file | false |
| debugSymbols | The native-debug-symbols.zip file or folder that contains your debug symbols | A path to a valid `native-debug-symbols.zip file` file or a folder | false |
Expand Down
25 changes: 18 additions & 7 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ async function expectRunInitiatesUpload(options: RunOptions) {
expect(result.commands.errors).toContainEqual("The incoming JSON object does not contain a client_email field")
}

test("correct bare minimum inputs", async () => {
const minimumOptions = RunOptions.create()
.setInputs({
serviceAccountJsonPlainText: "{}",
packageName: "com.package.name",
releaseFiles: "./__tests__/releasefiles/*.aab",
track: "production",
})
await expectRunInitiatesUpload(minimumOptions)
})

test("correct inputs for complete rollout", async () => {
// Run with the bare minimum
const minimumOptions = RunOptions.create()
Expand All @@ -34,8 +45,8 @@ test("correct inputs for complete rollout", async () => {
changesNotSentForReview: "true",
existingEditId: "123"
})
await expectRunInitiatesUpload(extraOptions)
})
await expectRunInitiatesUpload(extraOptions)
})

test("correct inputs for inProgress rollout", async () => {
// Run with the bare minimum
Expand All @@ -48,7 +59,7 @@ test("correct inputs for inProgress rollout", async () => {
userFraction: "0.99",
status: "inProgress",
})
await expectRunInitiatesUpload(minimumOptions)
await expectRunInitiatesUpload(minimumOptions)

// Test with optional extras
const extraOptions = RunOptions.create()
Expand All @@ -65,7 +76,7 @@ test("correct inputs for inProgress rollout", async () => {
changesNotSentForReview: "true",
existingEditId: "123"
})
await expectRunInitiatesUpload(extraOptions)
await expectRunInitiatesUpload(extraOptions)
})

test("correct inputs for draft rollout", async () => {
Expand All @@ -78,7 +89,7 @@ test("correct inputs for draft rollout", async () => {
track: "production",
status: "draft",
})
await expectRunInitiatesUpload(minimumOptions)
await expectRunInitiatesUpload(minimumOptions)

// Test with optional extras
const extraOptions = RunOptions.create()
Expand All @@ -94,5 +105,5 @@ test("correct inputs for draft rollout", async () => {
changesNotSentForReview: "true",
existingEditId: "123"
})
await expectRunInitiatesUpload(extraOptions)
})
await expectRunInitiatesUpload(extraOptions)
})
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ inputs:
required: false
status:
description: "Release status. This can be set to 'draft' to complete the release at some other time."
required: false
required: true
default: "completed"
whatsNewDirectory:
description: "The directory of localized whats new files"
required: false
Expand Down

0 comments on commit d7e6e42

Please sign in to comment.