Skip to content

Commit a24929e

Browse files
committed
Support For Android App bundle File Upload
1 parent 72897de commit a24929e

File tree

9 files changed

+488
-225
lines changed

9 files changed

+488
-225
lines changed

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,36 @@ ii. Go to https://console.developers.google.com/apis/credentials
3636

3737
iii. Select "Create credentials" > "Service Account key" and generate a new key for the Service that is associated to your Google Play service account.
3838

39-
### 4. Build apk file
39+
### 4. Build apk or aab file
4040

41-
Build signed production android apk file to upload. In case of a CI server, this file should be already generated.
41+
Build signed production android apk or aab file to upload. In case of a CI server, this file should be already generated.
4242

4343
### 4. Run Upload Command
4444

4545
Execute the binary, passing required data in arguments.
46-
47-
```bash
48-
java -jar release-manager-1.0.jar -key "key.json" -apk "app.apk" -track "internal" -name "myApp" -notes "new release"
49-
```
46+
* APK File
47+
```bash
48+
java -jar release-manager-1.0.jar -key "key.json" -apk "app.apk" -track "internal" -name "myApp" -notes "new release"
49+
```
50+
* AAB File
51+
```bash
52+
java -jar release-manager-1.0.jar -key "key.json" -apk "app.aab" -track "internal" -name "myApp" -notes "new release" -name appName -packageName app.package.name
53+
```
5054

5155
#### CLI Options
5256

5357
Running without any arguments will print available argument options.
5458

5559
```bash
5660
Options:
57-
-apk VAL : The apk file to publish
58-
-key VAL : JSON key file of authorized service account
59-
-name VAL : (optional) AndroidPublisher name on Play Store (defaults to
60-
name in apk)
61-
-notes VAL : (optional) Release notes
62-
-notesFile VAL : (optional) Release notes from file
63-
-track VAL : Release track to use. Eg. internal, alpha, beta or production
61+
-apk VAL : The apk file to publish
62+
-key VAL : JSON key file of authorized service account
63+
-name VAL : (optional) AndroidPublisher name on Play Store (defaults to
64+
name in apk)
65+
-notes VAL : (optional) Release notes
66+
-notesFile VAL : (optional) Release notes from file
67+
-track VAL : Release track to use. Eg. internal, alpha, beta or production
68+
-packageName VAL : (optional for apk) App Package Name
6469
```
6570

6671
## Development

pom.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
</parent>
1111
<groupId>com.rg</groupId>
1212
<artifactId>release-manager</artifactId>
13-
<version>1.0</version>
13+
<version>1.1</version>
1414
<name>app-release-manager</name>
15-
<description>Publishes APK File to Google Play Store</description>
15+
<description>Publishes APK OR AAB File to Google Play Store</description>
1616

1717
<properties>
1818
<java.version>1.8</java.version>
19+
<google.api.version>1.29.0</google.api.version>
1920
</properties>
2021

2122
<dependencies>
@@ -42,7 +43,7 @@
4243
<dependency>
4344
<groupId>com.google.api-client</groupId>
4445
<artifactId>google-api-client</artifactId>
45-
<version>1.28.0</version>
46+
<version>${google.api.version}</version>
4647
</dependency>
4748
<dependency>
4849
<groupId>com.google.apis</groupId>
@@ -52,17 +53,17 @@
5253
<dependency>
5354
<groupId>com.google.http-client</groupId>
5455
<artifactId>google-http-client</artifactId>
55-
<version>1.28.0</version>
56+
<version>${google.api.version}</version>
5657
</dependency>
5758
<dependency>
5859
<groupId>com.google.http-client</groupId>
5960
<artifactId>google-http-client-jackson2</artifactId>
60-
<version>1.28.0</version>
61+
<version>${google.api.version}</version>
6162
</dependency>
6263
<dependency>
6364
<groupId>com.google.oauth-client</groupId>
6465
<artifactId>google-oauth-client</artifactId>
65-
<version>1.28.0</version>
66+
<version>${google.api.version}</version>
6667
</dependency>
6768
<dependency>
6869
<groupId>com.google.guava</groupId>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package app.release.model;
2+
3+
import org.kohsuke.args4j.Option;
4+
5+
public class CommandLineArguments {
6+
7+
@Option(name = "-key", required = true, usage = "JSON key file of authorized service account")
8+
private String jsonKeyPath;
9+
10+
@Option(name = "-name", usage = "(optional) Provide with AAB File")
11+
private String appName;
12+
13+
@Option(name = "-packageName", usage = "(optional) Provide with AAB File")
14+
private String packageName;
15+
16+
@Option(name = "-file", required = true, usage = "APK Or AAB file to be released")
17+
private String file;
18+
19+
@Option(name = "-track", required = true, usage = "Release track to use. Eg. internal, alpha, beta or production")
20+
private String trackName;
21+
22+
@Option(name = "-notes", forbids = "-notesFile", usage = "(optional) Release notes")
23+
private String notes;
24+
25+
@Option(name = "-notesFile", forbids = "-notes", usage = "(optional) Release notes from file")
26+
private String notesPath;
27+
28+
public String getJsonKeyPath() {
29+
return jsonKeyPath;
30+
}
31+
32+
public void setJsonKeyPath(String jsonKeyPath) {
33+
this.jsonKeyPath = jsonKeyPath;
34+
}
35+
36+
public String getAppName() {
37+
return appName;
38+
}
39+
40+
public void setAppName(String appName) {
41+
this.appName = appName;
42+
}
43+
44+
public String getFile() {
45+
return file;
46+
}
47+
48+
public void setFile(String file) {
49+
this.file = file;
50+
}
51+
52+
public String getTrackName() {
53+
return trackName;
54+
}
55+
56+
public void setTrackName(String trackName) {
57+
this.trackName = trackName;
58+
}
59+
60+
public String getNotes() {
61+
return notes;
62+
}
63+
64+
public void setNotes(String notes) {
65+
this.notes = notes;
66+
}
67+
68+
public String getNotesPath() {
69+
return notesPath;
70+
}
71+
72+
public void setNotesPath(String notesPath) {
73+
this.notesPath = notesPath;
74+
}
75+
76+
public String getPackageName() {
77+
return packageName;
78+
}
79+
}

src/main/java/app/release/publish/AndroidPublisher.java

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)