From ae2a697e0134eeec269b2f15a2fca2489422c16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Sun, 18 Apr 2021 19:34:32 +0200 Subject: [PATCH] Merge pull request #1295 from wulkanowy/rbo/update-workflow Update github action workflow --- .github/workflows/deploy-store.yml | 75 +++++++++++++ .github/workflows/deploy-test.yml | 144 ++++++++++++++++++++++++ .github/workflows/test.yml | 174 +---------------------------- app/bitrise.jks | Bin 2235 -> 0 bytes app/build.gradle | 12 ++ build.gradle | 1 + 6 files changed, 235 insertions(+), 171 deletions(-) create mode 100644 .github/workflows/deploy-store.yml create mode 100644 .github/workflows/deploy-test.yml delete mode 100644 app/bitrise.jks diff --git a/.github/workflows/deploy-store.yml b/.github/workflows/deploy-store.yml new file mode 100644 index 00000000..3cd08e04 --- /dev/null +++ b/.github/workflows/deploy-store.yml @@ -0,0 +1,75 @@ +name: Deploy to app stores + +on: + release: + types: [ created ] + +jobs: + + deploy-google-play: + name: Deploy to google play + runs-on: ubuntu-latest + timeout-minutes: 10 + environment: google-play + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }} + - name: Decrypt keys + env: + ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }} + SERVICES_ENCRYPT_KEY: ${{ secrets.SERVICES_ENCRYPT_KEY }} + run: | + gpg --yes --batch --passphrase=$SERVICES_ENCRYPT_KEY ./app/src/release/google-services.json.gpg + gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/key.p12.gpg + gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/upload-key.jks.gpg + - name: Upload apk to google play + env: + PLAY_KEY_ALIAS: ${{ secrets.PLAY_KEY_ALIAS }} + PLAY_KEY_PASSWORD: ${{ secrets.PLAY_KEY_PASSWORD }} + PLAY_SERVICE_ACCOUNT_EMAIL: ${{ secrets.PLAY_SERVICE_ACCOUNT_EMAIL }} + PLAY_STORE_PASSWORD: ${{ secrets.PLAY_STORE_PASSWORD }} + run: ./gradlew publishPlayRelease -PenableFirebase --stacktrace; + + deploy-app-gallery: + name: Deploy to AppGallery + runs-on: ubuntu-latest + timeout-minutes: 10 + environment: app-gallery + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }} + - name: Decrypt keys + env: + ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }} + SERVICES_ENCRYPT_KEY: ${{ secrets.SERVICES_ENCRYPT_KEY }} + run: | + gpg --yes --batch --passphrase=$SERVICES_ENCRYPT_KEY ./app/src/release/agconnect-services.json.gpg + gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/key.p12.gpg + gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/upload-key.jks.gpg + - name: Build HMS version + env: + PLAY_KEY_ALIAS: ${{ secrets.PLAY_KEY_ALIAS }} + PLAY_KEY_PASSWORD: ${{ secrets.PLAY_KEY_PASSWORD }} + PLAY_STORE_PASSWORD: ${{ secrets.PLAY_STORE_PASSWORD }} + run: ./gradlew assembleHmsRelease --stacktrace + - name: Upload APK to AppGallery + env: + AGC_CLIENT_ID: ${{ secrets.AGC_CLIENT_ID }} + AGC_CLIENT_SECRET: ${{ secrets.AGC_CLIENT_SECRET }} + run: ./gradlew publishHuaweiAppGalleryHmsRelease --stacktrace; diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml new file mode 100644 index 00000000..88edca05 --- /dev/null +++ b/.github/workflows/deploy-test.yml @@ -0,0 +1,144 @@ +name: Deploy to app tests + +on: + push: +# branches: [ develop ] + branches: [ '!*' ] + pull_request_target: +# branches: [ develop ] + branches: [ '!*' ] + + workflow_dispatch: + +jobs: + + deploy-appcenter: + name: App Center + runs-on: ubuntu-latest + timeout-minutes: 10 + environment: app-center + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }} + - name: Set run number with offset + env: + BUILD_NUMBER_OFFSET: ${{ secrets.BUILD_NUMBER_OFFSET }} + run: echo "RUN_NUMBER=$((GITHUB_RUN_NUMBER+BUILD_NUMBER_OFFSET))" >> $GITHUB_ENV + - name: Prepare build configuration + run: | + sed -i -e "s#applicationIdSuffix \".dev\"#applicationIdSuffix \".${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/build.gradle + sed -i -e "s#.dev\"#.${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/src/debug/google-services.json + sed -i -e "s#.dev\"#.${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/src/debug/agconnect-services.json + sed -i -e '/versionNameSuffix/d' app/build.gradle + - name: Add signing config + run: | + cat >> app/build.gradle <> $GITHUB_ENV + - name: Add signing config + run: | + cat >> app/build.gradle <> $GITHUB_ENV - - name: Prepare build configuration - run: | - sed -i -e "s#applicationIdSuffix \".dev\"#applicationIdSuffix \".${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/build.gradle - sed -i -e "s#.dev\"#.${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/src/debug/google-services.json - sed -i -e "s#.dev\"#.${GITHUB_HEAD_REF//[-.\/]/_}\"#" app/src/debug/agconnect-services.json - sed -i -e '/versionNameSuffix/d' app/build.gradle - - name: Add signing config - run: | - cat >> app/build.gradle <> $GITHUB_ENV - - name: Add signing config - run: | - cat >> app/build.gradle <|>OrkVM({XJB2r_xf|zEx)1th{ z%IJp?B$NIOEia$u?&SS%8)*@`A5{K=BIU}&)n10q6DZ4w z&3gjkYM9Z7^hn0pL==pfn;((9#2hJ)1A;HfRmS(32RjR0R$M>cx*n}>=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@ apply plugin: 'kotlin-kapt' apply plugin: 'dagger.hilt.android.plugin' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.github.triplet.play' +apply plugin: 'ru.cian.huawei-publish' apply plugin: 'com.mikepenz.aboutlibraries.plugin' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.huawei.agconnect' @@ -140,6 +141,17 @@ play { updatePriority = 3 } +huaweiPublish { + instances { + hmsRelease { + clientId = System.getenv("AGC_CLIENT_ID") + clientSecret = System.getenv("AGC_CLIENT_SECRET") + buildFormat = "apk" + deployType = "draft" + } + } +} + ext { work_manager = "2.5.0" work_hilt = "1.0.0-beta01" diff --git a/build.gradle b/build.gradle index 21ae47e7..222ea177 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ buildscript { classpath 'com.huawei.agconnect:agcp:1.5.1.200' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1' classpath "com.github.triplet.gradle:play-publisher:2.8.0" + classpath "ru.cian:huawei-publish-gradle-plugin:1.2.2" classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1" classpath "gradle.plugin.com.star-zero.gradle:githook:1.2.0" classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$about_libraries"