Skip to content

Colota - Android GPS Location tracker

added workflows for builds

Max Dietrich98ae06fdfbb6
diff --git a/.github/workflows/latest-release.yml b/.github/workflows/latest-release.yml
index 661a9013..46469cd0 100644
--- a/.github/workflows/latest-release.yml
+++ b/.github/workflows/latest-release.yml
@@ -10,7 +10,6 @@ concurrency:
cancel-in-progress: true
jobs:
- # JOB 1: Verification
test:
name: Lint & Test
runs-on: ubuntu-latest
@@ -20,19 +19,14 @@ jobs:
with:
node-version: '20'
cache: 'npm'
-
- run: npm ci
- - name: Run Lint
- run: npm run lint
- - name: Run Type Check
- run: npx tsc --noEmit
- - name: Run Tests
- run: npm test
+ - run: npm run lint
+ - run: npx tsc --noEmit
+ - run: npm test
- # JOB 2: Build & Release (Only runs if 'test' passes)
build-and-release:
name: Build & Update Latest
- needs: test # <--- THIS IS THE MAGIC LINE
+ needs: test
runs-on: ubuntu-latest
permissions:
contents: write
@@ -57,21 +51,30 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Create gradle.properties
+ run: |
+ echo "android.useAndroidX=true" >> android/gradle.properties
+ echo "android.enableJetifier=true" >> android/gradle.properties
+ echo "hermesEnabled=true" >> android/gradle.properties
+ echo "newArchEnabled=true" >> android/gradle.properties
+ # These allow your build.gradle logic to work without secrets in Git
+ echo "MYAPP_UPLOAD_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> android/gradle.properties
+ echo "MYAPP_UPLOAD_KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> android/gradle.properties
+ echo "MYAPP_UPLOAD_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> android/gradle.properties
+
- name: Decode keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: echo $KEYSTORE_BASE64 | base64 -d > android/app/release.keystore
- name: Build Release APK
- env:
- KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
- KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
cd android
- # Grant execution permission to the gradlew wrapper
- chmod +x gradlew
- ./gradlew assembleRelease --no-daemon
+ chmod +x gradlew
+ # We pass the flags here as well to be 100% safe with Gradle 9.0
+ ./gradlew assembleRelease --no-daemon \
+ -PhermesEnabled=true \
+ -Pandroid.useAndroidX=true
- name: Update Latest Tag
run: |
@@ -97,4 +100,4 @@ jobs:
- name: Secure Cleanup
if: always()
- run: shred -u android/app/release.keystore
\ No newline at end of file
+ run: shred -u android/app/release.keystore android/gradle.properties
\ No newline at end of file