Skip to content

Commit a4eed76

Browse files
committed
Setting up automated releases
1 parent 036ca2d commit a4eed76

22 files changed

Lines changed: 230 additions & 0 deletions

File tree

.github/workflows/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# GitHub Actions Workflow for Google Play Publishing
2+
3+
This directory contains GitHub Actions workflow configurations for automating the build and deployment process of the
4+
Secure Camera app to Google Play.
5+
6+
## Workflow: Publish to Play Store
7+
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.
10+
11+
### Workflow Steps
12+
13+
1. Checkout the code
14+
2. Set up JDK 11
15+
3. Set up Ruby and install Fastlane
16+
4. Decode the Android keystore from a base64-encoded secret
17+
5. Build the release AAB with proper signing
18+
6. Decode the Google Play service account key
19+
7. Deploy to Google Play using Fastlane
20+
21+
### Required Secrets
22+
23+
The following secrets must be configured in your GitHub repository settings:
24+
25+
1. **ENCODED_KEYSTORE**: Base64-encoded Android keystore file
26+
```bash
27+
# Generate using:
28+
base64 -w 0 keystore.jks > keystore_base64.txt
29+
```
30+
31+
2. **KEYSTORE_PASSWORD**: Password for the keystore
32+
33+
3. **KEY_ALIAS**: Alias of the key in the keystore
34+
35+
4. **KEY_PASSWORD**: Password for the key
36+
37+
5. **PLAY_STORE_CONFIG_JSON**: Google Play service account JSON key file content
38+
- This is used by Fastlane to authenticate with Google Play
39+
- You need to create a service account in the Google Play Console with the appropriate permissions
40+
41+
### How to Use
42+
43+
1. Set up all the required secrets in your GitHub repository settings
44+
2. When you're ready to release a new version:
45+
- Update the version information in `gradle/libs.versions.toml`
46+
- Commit and push the changes
47+
- Create and push a new tag with the format `v1.0.0` (matching your version)
48+
```bash
49+
git tag v1.0.0
50+
git push origin v1.0.0
51+
```
52+
3. The workflow will automatically trigger and deploy the app to Google Play
53+
54+
### Troubleshooting
55+
56+
If the workflow fails, check the following:
57+
58+
1. Ensure all secrets are correctly configured
59+
2. Verify that the keystore is valid and contains the correct key
60+
3. Make sure the Google Play service account has the necessary permissions
61+
4. Check that the app's version code has been incremented since the last release
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish to Play Store
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and publish to Play Store
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '11'
22+
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: '3.2'
27+
bundler-cache: true
28+
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@v3
31+
32+
- name: Decode Keystore
33+
env:
34+
ENCODED_KEYSTORE: ${{ secrets.ENCODED_KEYSTORE }}
35+
run: |
36+
echo $ENCODED_KEYSTORE | base64 -d > keystore.jks
37+
38+
- name: Build Release AAB
39+
env:
40+
KEYSTORE_FILE: keystore.jks
41+
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
42+
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
43+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
44+
run: ./gradlew bundleRelease
45+
46+
- name: Setup Fastlane
47+
run: |
48+
gem install fastlane
49+
50+
- name: Decode service account key
51+
env:
52+
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
53+
run: echo $PLAY_STORE_CONFIG_JSON > fastlane/play-store-config.json
54+
55+
- name: Deploy to Play Store
56+
run: fastlane deploy

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ Pull requests are happily accepted.
4242

4343
Start with an issue or draft PR and we can talk it through.
4444

45+
### Automated Publishing
46+
47+
The project uses GitHub Actions to automatically build and publish new releases to Google Play when a tag with the
48+
format `v*` (e.g., `v1.0.0`) is pushed. See the [GitHub Actions workflow documentation](.github/workflows/README.md) for
49+
details on how this works and the required setup.
50+
51+
The project includes a pre-configured [FastLane](https://fastlane.tools/) setup for automating the deployment process.
52+
See the [FastLane documentation](fastlane/README.md) for details on how to use it for manual deployments or to customize
53+
the metadata.
54+
4555
---
4656

4757
## License

app/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ android {
2626
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2727
}
2828

29+
signingConfigs {
30+
create("release") {
31+
storeFile = file(System.getenv("KEYSTORE_FILE") ?: "keystore.jks")
32+
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: ""
33+
keyAlias = System.getenv("KEY_ALIAS") ?: ""
34+
keyPassword = System.getenv("KEY_PASSWORD") ?: ""
35+
}
36+
}
37+
2938
buildTypes {
3039
release {
3140
isMinifyEnabled = true
3241
proguardFiles(
3342
getDefaultProguardFile("proguard-android-optimize.txt"),
3443
"proguard-rules.pro"
3544
)
45+
signingConfig = signingConfigs.getByName("release")
3646
}
3747
}
3848
compileOptions {

fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package_name("com.darkrockstudios.app.securecamera")
2+
json_key_file("play-store-config.json")

fastlane/Fastfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
default_platform(:android)
2+
3+
platform :android do
4+
desc "Deploy to Play Store"
5+
lane :deploy do
6+
upload_to_play_store(
7+
track: 'production',
8+
aab: '../app/build/outputs/bundle/release/app-release.aab',
9+
skip_upload_metadata: false,
10+
skip_upload_images: false,
11+
skip_upload_screenshots: false,
12+
release_status: 'completed'
13+
)
14+
end
15+
end

fastlane/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# FastLane Setup for Snap Safe
2+
3+
This directory contains the FastLane configuration for automating the deployment of Snap Safe to Google Play.
4+
5+
## Directory Structure
6+
7+
- `Fastfile`: Defines the deployment lanes for FastLane
8+
- `Appfile`: Contains app-specific configuration (package name, service account key path)
9+
- `metadata/`: Contains app metadata for Google Play
10+
- `android/`: Platform-specific metadata
11+
- `en-US/`: English (US) metadata
12+
- `title.txt`: App title
13+
- `short_description.txt`: Short app description
14+
- `full_description.txt`: Full app description
15+
- `images/`: App screenshots and images
16+
- `phoneScreenshots/`: Screenshots for phones
17+
18+
## How to Use
19+
20+
### Prerequisites
21+
22+
1. Install FastLane:
23+
```bash
24+
gem install fastlane
25+
```
26+
27+
2. Set up a Google Play service account and download the JSON key file
28+
- Place the key file in the fastlane directory as `play-store-config.json`
29+
- Make sure the service account has the necessary permissions in the Google Play Console
30+
31+
### Deploying to Google Play
32+
33+
To deploy a new version to Google Play:
34+
35+
1. Update the version information in `gradle/libs.versions.toml`
36+
2. Build the release AAB:
37+
```bash
38+
./gradlew bundleRelease
39+
```
40+
3. Run the deploy lane:
41+
```bash
42+
fastlane deploy
43+
```
44+
45+
### Automated Deployment
46+
47+
The project uses GitHub Actions to automatically build and deploy new releases to Google Play when a tag with the format
48+
`v*` (e.g., `v1.0.0`) is pushed. See the [GitHub Actions workflow documentation](../.github/workflows/README.md) for
49+
details.
50+
51+
## Customizing Metadata
52+
53+
To update the app metadata:
54+
55+
1. Edit the files in the `metadata/android/en-US/` directory
56+
2. Add screenshots to the `metadata/android/en-US/images/phoneScreenshots/` directory
57+
3. Run the deploy lane to upload the updated metadata to Google Play
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Snap Safe is an Android camera app that keeps every pixel—and every byte of data—exactly where it belongs: on YOUR device.
2+
3+
Key Features:
4+
• Zero‑Leak Design – The manifest skips android.permission.INTERNET; nothing leaves your device.
5+
• Fully Encrypted – Shots are written to encrypted, app‑private storage.
6+
• Metadata Scrub‑A‑Dub – EXIF and other identifiers are wiped the instant you hit Share.
7+
• PIN‑Locked Gallery – A separate PIN stands between curious thumbs and your photos.
8+
• Secure Sharing – When you do share, we hand the file off via Android's native share sheet—no detours.
9+
• Granular Location – Add coarse, fine, or zero location data—your call.
10+
• 100% Open Source – Auditable code in plain sight.
11+
12+
Why Snap Safe?
13+
We capture photos locally, encrypt everything in private storage, let YOU decide if GPS tags are added (precision optional), and strip out tell‑tale metadata automatically.
14+
15+
We NEVER phone home or talk to servers, slurp analytics or usage stats, sprinkle ads or trackers in the code, or read files outside our sandbox.
16+
17+
Privacy Policy: We collect nothing.
44.8 KB
Loading
26.1 KB
Loading

0 commit comments

Comments
 (0)