Skip to content

Commit 586287a

Browse files
committed
Update README with CI/CD and release signing instructions
1 parent d4137a4 commit 586287a

1 file changed

Lines changed: 51 additions & 3 deletions

File tree

README.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,55 @@ NeuralPulse/
113113

114114
## Building the Ecosystem
115115

116-
1. **Gradle Imports**: Ensure settings include :app, :wear, and :shared modules in settings.gradle.kts.
117-
2. **Local SDK Bindings**: Copy the proprietary Samsung SDK binaries (samsung-health-data-api.aar and samsung-health-sensor-api.aar) into the libs/ folder inside :app and :wear modules.
118-
3. **Ingest Vision Model**: Place your retrained model food_nutrition_v1.tflite inside app/src/main/assets/models/.
116+
1. **Gradle Imports**: Ensure settings include `:app`, `:wear`, and `:shared` modules in `settings.gradle.kts`.
117+
2. **Local SDK Bindings**: Copy the proprietary Samsung SDK binaries (`samsung-health-data-api.aar` and `samsung-health-sensor-api.aar`) into the `libs/` folder inside the `:app` and `:wear` modules.
118+
3. **Ingest Vision Model**: Place your retrained model `food_nutrition_v1.tflite` inside `app/src/main/assets/models/`.
119119
4. **Android Developer Mode**: Turn on Developer Mode inside Samsung Health on both testing devices to enable raw SDK sensor reads.
120+
121+
---
122+
123+
## CI/CD Pipeline & Automated Release Signing
124+
125+
The project features a continuous integration pipeline configured in [build.yml](file:///.github/workflows/build.yml) that executes unit tests, builds debug and release APKs for both the phone companion app and the Wear OS watch app, and automatically generates GitHub Releases for pushes to the `master` branch.
126+
127+
### Dynamic APK Signing Architecture
128+
129+
To prevent build failures for contributors who do not possess the release keystore, the Gradle build scripts ([app/build.gradle.kts](file:///app/build.gradle.kts) and [wear/build.gradle.kts](file:///wear/build.gradle.kts)) use a dynamic signing configuration:
130+
- If `release.jks` exists in the module root directory, Gradle automatically signs the release build with it.
131+
- If `release.jks` is missing, Gradle compiles the release build without throwing an exception, outputting an unsigned release APK.
132+
- The CI pipeline standardizes outputs into `app-release-final.apk` and `wear-release-final.apk` to handle both signed and unsigned scenarios uniformly.
133+
134+
### How to Configure Automated Releases & Signing
135+
136+
To set up fully-signed automated releases in your repository, follow these steps:
137+
138+
#### 1. Generate a Release Keystore
139+
Run the following JDK tool command locally to generate a new signing keystore:
140+
```bash
141+
keytool -genkey -v -keystore release.jks -keyalg RSA -keysize 2048 -validity 10000 -alias neuralpulse-key
142+
```
143+
Note down your keystore password, key alias, and key password.
144+
145+
#### 2. Base64-Encode the Keystore
146+
Encode the binary `release.jks` file to a Base64 string to store it securely in GitHub:
147+
- **macOS/Linux**:
148+
```bash
149+
base64 -i release.jks -o keystore.b64
150+
cat keystore.b64
151+
```
152+
- **Windows (PowerShell)**:
153+
```powershell
154+
[Convert]::ToBase64String([IO.File]::ReadAllBytes("release.jks")) | Out-File -FilePath keystore.b64
155+
Get-Content keystore.b64
156+
```
157+
158+
#### 3. Configure GitHub Repository Secrets
159+
Go to your GitHub repository, navigate to **Settings > Secrets and variables > Actions**, and add the following repository secrets:
160+
161+
* `ANDROID_KEYSTORE_BASE64`: The full Base64-encoded string representing your keystore file.
162+
* `ANDROID_KEYSTORE_PASSWORD`: The password set for the keystore container.
163+
* `ANDROID_KEY_ALIAS`: The key alias (e.g., `neuralpulse-key`).
164+
* `ANDROID_KEY_PASSWORD`: The password set for the specific key alias.
165+
166+
Once configured, any push to the `master` branch will trigger the pipeline, automatically decode the keystore, build signed APKs, and publish them directly to a release page on GitHub.
167+

0 commit comments

Comments
 (0)