Skip to content

Commit

Permalink
Chore: Update readme (r0adkll#115)
Browse files Browse the repository at this point in the history
* Update README formatting

* Sort inputs by required

* Sort track values by priority

* Table-ify inputs in README

* Table-ify outputs too

* Bring back the `whatsNewDirectory` example
  • Loading branch information
boswelja authored Jun 18, 2022
1 parent 7b7381e commit f1479e7
Showing 1 changed file with 31 additions and 104 deletions.
135 changes: 31 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,125 +4,52 @@ This action will help you upload an Android `.apk` or `.aab` (Android App Bundle

## Inputs

_You must provide one of either `serviceAccountJson` or `serviceAccountJsonPlainText`_

### `serviceAccountJson`

The service account json private key file to authorize the upload request

### `serviceAccountJsonPlainText`

The service account json in plain text, provided via a secret, etc.

### `packageName`

**Required:** The package name, or Application Id, of the app you are uploading

### ~~`releaseFile`~~
**DEPRECATED:** Please switch to using `releaseFiles` as this will be removed in the future
The Android release file to upload (.apk or .aab)

### `releaseFiles`
**CAVEAT:** Either this or `releaseFile` are required

The Android release file(s) to upload (.apk or .aab). Multiple files are separated by ','. Supports glob.

### `releaseName`

The release name. Not required to be unique. If not set, the name is generated from the APK's versionName. If the release contains multiple APKs, the name is generated from the date.

### `track`

**Required:** The track in which you want to assign the uploaded app.
**Default:** `production`
_Values:_ `alpha`, `beta`, `internal`, `production`, `internalsharing`

### `inAppUpdatePriority`

In-app update priority of the release. All newly added APKs in the release will be considered at this priority. Can take values in the range [0, 5], with 5 the highest priority.

**Default:** `0`
_Values:_ `[0, 5]`

### `userFraction`

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.
* `en-US` - English/America
* `de-DE` - German/Germany
* `ja-JP` - Japanese/Japan

and contain plain `utf8` encoded text with no extension on the file. The resulting directory in your project should look something like this:
```
projectDir/
└── whatsNewDirectory/
├── whatsnew-en-US
├── whatsnew-de-DE
└── whatsnew-ja-JP
```
where `whatsNewDirectory` is the path you pass to the action.


### `mappingFile`

The mapping.txt file used to de-obfuscate your stack traces from crash reports
| Input | Description | Value | Required |
| --- | --- | --- | --- |
| releaseFiles | The Android release file(s) to upload (.apk or .aab) | Comma-separated paths. Supports glob via [fast-glob](https://github.com/mrmlnc/fast-glob) | true |
| serviceAccountJsonPlainText | The service account json in plain text, provided via a secret, etc | The contents of your `service-account.json` | true (or serviceAccountJson) |
| packageName | The package name, or Application Id, of the app you are uploading | A valid package name, e.g. `com.example.myapp` | true |
| track | The track in which you want to assign the uploaded app. Defaults to `production` | One of `production`, `beta`, `alpha`, `internalsharing`, `internal`, or a custom track name (case sensitive) | true |
| 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)` | false |
| status | Release status. This can be set to `draft` to complete the release at some other time. Defaults to `completed` if targeting 100% rollout, else `inProgress` | One of `completed`, `inProgress`, `halted`, `draft` | false |
| 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 |
| serviceAccountJson | The service account json private key file to authorize the upload request. Can be used instead of `serviceAccountJsonPlainText` to specify a file rather than provide a secret | A path to a valid `service-account.json` file | true (or serviceAccountJsonPlainText) |
| ~~releaseFile~~ | Please switch to using `releaseFiles` as this will be removed in the future | | false |

## Outputs

### `internalSharingDownloadUrls`

A JSON list containing the download urls for every release file uploaded using the `track` `internalsharing`

### ENV VAR: `INTERNAL_SHARING_DOWNLOAD_URLS`

The environment variable that is set when using the `track` `internalsharing`

### `internalSharingDownloadUrl`

The download url for the last release file uploaded using the `track` `internalsharing`, useful when a single release file is uploaded

### ENV VAR: `INTERNAL_SHARING_DOWNLOAD_URL`

The environment variable that is set when using the `track` `internalsharing`
| Output | Environment Variable | Description |
| --- | --- | --- |
| internalSharingDownloadUrls | INTERNAL_SHARING_DOWNLOAD_URLS | A JSON list containing the download urls for every release file uploaded using the `internalsharing` track |
| internalSharingDownloadUrl | INTERNAL_SHARING_DOWNLOAD_URL | The download url for the last release file uploaded using the `internalsharing` track |

## Example usage

The below example publishes `MyApp` to Google Play, targetting 33% (`0.33`) of users with a priority of `2`.

```yaml
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ SERVICE_ACCOUNT_JSON }}
serviceAccountJsonPlainText: ${{ SERVICE_ACCOUNT_JSON }}
packageName: com.example.MyApp
releaseFiles: ${{ SIGNED_RELEASE_FILE}}
releaseFiles: app/build/outputs/bundle/release/app-release.aab
track: production
status: completed
status: inProgress
inAppUpdatePriority: 2
userFraction: 0.33
whatsNewDirectory: distribution/whatsnew
mappingFile: app/build/outputs/mapping/release/mapping.txt
```
Using glob to get release files
```yaml
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ SERVICE_ACCOUNT_JSON }}
packageName: com.example.MyApp
releaseFiles: app/build/outputs/bundle/release/*.aab
track: production
status: completed
inAppUpdatePriority: 2
userFraction: 0.33
whatsNewDirectory: distribution/whatsnew
mappingFile: app/build/outputs/mapping/release/mapping.txt
The `whatsNewDirectory` in this example supplies changelogs for English, German and Japanese

```
distribution/
└─ whatsnew/
├─ whatsnew-en-US
├─ whatsnew-de-DE
└─ whatsnew-ja-JP
```

0 comments on commit f1479e7

Please sign in to comment.