diff --git a/.github/workflows/deploy_to_github.yml b/.github/workflows/deploy_foss_to_github.yml similarity index 78% rename from .github/workflows/deploy_to_github.yml rename to .github/workflows/deploy_foss_to_github.yml index 49520c5c..ff891611 100644 --- a/.github/workflows/deploy_to_github.yml +++ b/.github/workflows/deploy_foss_to_github.yml @@ -1,4 +1,4 @@ -name: Deploy to github +name: Deploy Foss to github on: push: @@ -39,6 +39,13 @@ jobs: build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" build-scan-terms-of-use-agree: "yes" + - name: Remove Firebase References + run: | + sed -i -e '/mlkit/,+14d' -e '/google-services/d' -e '/firebase/d' build.gradle.kts + sed -i -e '/with(target) {/,/^ }/d' -e '/CrashlyticsExtension/d' build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt + sed -i -e '/androidx.dev/d' settings.gradle.kts + sed -i -e '/mlkit/,+14d' -e '/google-services/d' -e '/libs.firebase/d' build-logic/convention/build.gradle.kts + - name: Generate Release APK run: ./gradlew assembleFossReliantRelease @@ -53,20 +60,6 @@ jobs: env: BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - - name: Generate Release APK - run: ./gradlew assembleGooglePlayRelease - - - name: Sign APK - uses: r0adkll/sign-android-release@v1 - with: - releaseDirectory: app/build/outputs/apk/googlePlay/release - signingKeyBase64: ${{ secrets.SIGNING_KEY }} - alias: ${{ secrets.ALIAS }} - keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} - keyPassword: ${{ secrets.KEY_PASSWORD }} - env: - BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} - # 4 - name: Draft Release uses: ncipollo/release-action@v1.14.0 diff --git a/.github/workflows/deploy_play_to_github.yml b/.github/workflows/deploy_play_to_github.yml new file mode 100644 index 00000000..11c92de5 --- /dev/null +++ b/.github/workflows/deploy_play_to_github.yml @@ -0,0 +1,65 @@ +name: Deploy Play to github + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +## 2 +jobs: + ## 3 + build: + runs-on: ubuntu-latest + steps: + # 1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + # 2 + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Setup build tool version variable + shell: bash + run: | + BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV + echo Last build tool version is: $BUILD_TOOL_VERSION + + - name: Accept Android licenses + run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" + build-scan-terms-of-use-agree: "yes" + + - name: Generate Release APK + run: ./gradlew assembleGooglePlayRelease + + - name: Sign APK + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: app/build/outputs/apk/googlePlay/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} + + # 4 + - name: Draft Release + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: true + artifacts: "app/build/outputs/apk/**/**/**/*.apk,app/build/outputs/mapping/**/**/*.txt" + token: ${{ secrets.TOKEN }} + generateReleaseNotes: true + bodyFile: distribution/whatsnew/whatsnew-en-US + prerelease: false diff --git a/instuctions b/instuctions index 4973ff02..a17e70a4 100644 --- a/instuctions +++ b/instuctions @@ -10,7 +10,8 @@ ./gradlew :app:generateReleaseBaselineProfile - sed -i -e '/google-services/d' -e '/firebase/d' ../build.gradle.kts; - sed -i -e '/mlkit/,+14d' -e '/google-services/d' -e '/firebase/d' build.gradle.kts; - sed -i -e '/with(target) {/,/^ }/d' -e '/CrashlyticsExtension/d' build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt + sed -i -e '/mlkit/,+14d' -e '/google-services/d' -e '/firebase/d' build.gradle.kts; + sed -i -e '/with(target) {/,/^ }/d' -e '/CrashlyticsExtension/d' build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt; + sed -i -e '/androidx.dev/d' settings.gradle.kts; + sed -i -e '/mlkit/,+14d' -e '/google-services/d' -e '/libs.firebase/d' build-logic/convention/build.gradle.kts;