diff --git a/.github/workflows/assemble.yml b/.github/workflows/assemble.yml new file mode 100644 index 000000000..bc4d445ac --- /dev/null +++ b/.github/workflows/assemble.yml @@ -0,0 +1,44 @@ +name: Assemble + +on: + push: + branches: [ "master" ] + workflow_dispatch: + +env: + keystore_password: ${{ secrets.KeystorePassword }} + keystore_alias: ${{ secrets.KeystoreAlias }} + keystore_alias_password: ${{ secrets.KeystoreAliasPassword }} + +jobs: + assemble-release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: 'gradle' + + - name: Decrypt keystore file + run: | + gpg --quiet --batch --yes --decrypt \ + --passphrase="${{ secrets.KeystoreEncKey }}" \ + --output release.jks \ + opencamera-sensors.jks.gpg + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Assemble release + run: ./gradlew assembleRelease + + - name: Upload release APK + uses: actions/upload-artifact@v3 + with: + name: release-apk + path: app/build/outputs/apk/release/app-release.apk + if-no-files-found: error diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 307efdd5d..090badf9e 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -12,43 +12,26 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: - distribution: 'adopt' - java-version: '8' - - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + distribution: 'temurin' + java-version: '11' + cache: 'gradle' - name: Decrypt keystore file - env: - enc_key: ${{ secrets.KeystoreEncKey }} - run: gpg --quiet --batch --yes --decrypt --passphrase="$enc_key" --output my-release-key.keystore my-release-key.keystore.gpg - - - name: Assemble debug - run: ./gradlew assembleDebug + run: | + gpg --quiet --batch --yes --decrypt \ + --passphrase="${{ secrets.KeystoreEncKey }}" \ + --output release.jks \ + opencamera-sensors.jks.gpg - - name: Assemble release - run: ./gradlew assembleRelease + - name: Grant execute permission for gradlew + run: chmod +x gradlew - name: Test debug run: ./gradlew testDebugUnitTest - name: Test release run: ./gradlew testReleaseUnitTest - - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/app/build.gradle b/app/build.gradle index 17cb26d6d..829664e22 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,16 +25,9 @@ android { signingConfigs { release - debug if (System.getenv("CI")) { release { - storeFile rootProject.file("my-release-key.keystore") - storePassword System.getenv("keystore_password") - keyAlias System.getenv("keystore_alias") - keyPassword System.getenv("keystore_alias_password") - } - debug { - storeFile rootProject.file("my-release-key.keystore") + storeFile rootProject.file("release.jks") storePassword System.getenv("keystore_password") keyAlias System.getenv("keystore_alias") keyPassword System.getenv("keystore_alias_password") @@ -48,10 +41,6 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' signingConfig signingConfigs.release } - debug { - minifyEnabled false - signingConfig signingConfigs.debug - } } lintOptions { diff --git a/my-release-key.keystore.gpg b/my-release-key.keystore.gpg deleted file mode 100644 index 5b0eb8227..000000000 Binary files a/my-release-key.keystore.gpg and /dev/null differ diff --git a/opencamera-extended-0152130a4960.json.enc b/opencamera-extended-0152130a4960.json.enc deleted file mode 100644 index e440fd6ff..000000000 Binary files a/opencamera-extended-0152130a4960.json.enc and /dev/null differ diff --git a/opencamera-sensors.jks.gpg b/opencamera-sensors.jks.gpg new file mode 100644 index 000000000..38a9e7200 Binary files /dev/null and b/opencamera-sensors.jks.gpg differ