Skip to content

Commit 0df8967

Browse files
committed
Build script update
1 parent 6164a1d commit 0df8967

File tree

3 files changed

+56
-15
lines changed

3 files changed

+56
-15
lines changed

.github/workflows/README.md

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
1-
# GitHub Actions Workflow for Google Play Publishing
1+
# GitHub Actions Workflows for App Publishing
22

33
This directory contains GitHub Actions workflow configurations for automating the build and deployment process of the
4-
Secure Camera app to Google Play.
4+
Secure Camera app to both Google Play and GitHub Releases.
55

6-
## Workflow: Publish to Play Store
6+
## Workflow: Publish Releases
77

8-
The `publish-to-play-store.yml` workflow automatically builds and publishes the app to Google Play when a new tag with
9-
the format `v*` (e.g., `v1.0.0`) is pushed to the repository.
8+
The `publish-release.yml` workflow automatically builds and publishes the app when a new tag with
9+
the format `v*` (e.g., `v1.0.0`) is pushed to the repository. It contains two jobs:
1010

11-
### Workflow Steps
11+
1. Build and publish to Play Store
12+
2. Build and publish GitHub release
13+
14+
### Play Store Job Steps
1215

1316
1. Checkout the code
14-
2. Set up JDK 11
17+
2. Set up JDK 17
1518
3. Set up Ruby and install Fastlane
1619
4. Decode the Android keystore from a base64-encoded secret
1720
5. Build the release AAB with proper signing
1821
6. Decode the Google Play service account key
1922
7. Deploy to Google Play using Fastlane
2023

24+
### GitHub Release Job Steps
25+
26+
1. Checkout the code
27+
2. Set up JDK 17
28+
3. Decode a separate Android keystore from a base64-encoded secret
29+
4. Build a signed release APK
30+
5. Create a GitHub release
31+
6. Attach the APK to the release
32+
2133
### Required Secrets
2234

35+
#### For Play Store Publishing
36+
2337
The following secrets must be configured in your GitHub repository settings:
2438

2539
1. **ENCODED_KEYSTORE**: Base64-encoded Android keystore file
@@ -38,9 +52,28 @@ The following secrets must be configured in your GitHub repository settings:
3852
- This is used by Fastlane to authenticate with Google Play
3953
- You need to create a service account in the Google Play Console with the appropriate permissions
4054

55+
#### For GitHub Release Publishing
56+
57+
The following secrets must be configured in your GitHub repository settings:
58+
59+
1. **GITHUB_RELEASE_ENCODED_KEYSTORE**: Base64-encoded Android keystore file (separate from Play Store keystore)
60+
```bash
61+
# Generate using:
62+
base64 -w 0 github_release_keystore.jks > github_release_keystore_base64.txt
63+
```
64+
65+
2. **GITHUB_RELEASE_KEYSTORE_PASSWORD**: Password for the GitHub release keystore
66+
67+
3. **GITHUB_RELEASE_KEY_ALIAS**: Alias of the key in the GitHub release keystore
68+
69+
4. **GITHUB_RELEASE_KEY_PASSWORD**: Password for the key in the GitHub release keystore
70+
4171
### How to Use
4272

43-
1. Set up all the required secrets in your GitHub repository settings
73+
1. Set up all the required secrets in your GitHub repository settings:
74+
- For Play Store publishing: ENCODED_KEYSTORE, KEYSTORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD, PLAY_STORE_CONFIG_JSON
75+
- For GitHub release publishing: GITHUB_RELEASE_ENCODED_KEYSTORE, GITHUB_RELEASE_KEYSTORE_PASSWORD,
76+
GITHUB_RELEASE_KEY_ALIAS, GITHUB_RELEASE_KEY_PASSWORD
4477
2. When you're ready to release a new version:
4578
- Update the version information in `gradle/libs.versions.toml`
4679
- Commit and push the changes
@@ -49,13 +82,24 @@ The following secrets must be configured in your GitHub repository settings:
4982
git tag v1.0.0
5083
git push origin v1.0.0
5184
```
52-
3. The workflow will automatically trigger and deploy the app to Google Play
85+
3. The workflow will automatically trigger and:
86+
- Deploy the app to Google Play
87+
- Create a GitHub release with the signed APK attached
5388

5489
### Troubleshooting
5590

5691
If the workflow fails, check the following:
5792

58-
1. Ensure all secrets are correctly configured
93+
#### For Play Store Publishing
94+
95+
1. Ensure all Play Store secrets are correctly configured
5996
2. Verify that the keystore is valid and contains the correct key
6097
3. Make sure the Google Play service account has the necessary permissions
6198
4. Check that the app's version code has been incremented since the last release
99+
100+
#### For GitHub Release Publishing
101+
102+
1. Ensure all GitHub release secrets are correctly configured
103+
2. Verify that the GitHub release keystore is valid and contains the correct key
104+
3. Check that you have the necessary permissions to create releases in the repository
105+
4. Verify that the APK is being built correctly

.github/workflows/publish-release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ jobs:
9393
run: |
9494
echo $ENCODED_KEYSTORE | base64 -d > app/keystore.jks
9595
96-
- name: Run Unit Tests
97-
run: ./gradlew test
98-
9996
- name: Build Release AAB
10097
env:
10198
KEYSTORE_FILE: keystore.jks

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
2-
versionCode = "4"
3-
versionName = "1.3"
2+
versionCode = "5"
3+
versionName = "1.3.1"
44

55
javaVersion = "11"
66
agp = "8.9.2"

0 commit comments

Comments
 (0)