From bd65fd8782fede5e01d1399b449448eb06edaba9 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:14:31 +0200 Subject: [PATCH 01/19] Upload APK to github artifacts Rename apk --- .github/workflows/pr_test_build.yml | 187 +++++++++++++++------------- 1 file changed, 102 insertions(+), 85 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index dd2f1edeb..398f1edd5 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -11,89 +11,89 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: '8.x' - - - name: Flutter action - uses: subosito/flutter-action@v1 - with: - flutter-version: '3.3.x' - channel: stable - - - name: Install package dependencies - run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang - - - name: Execute Build and Setup Commands - run: | - sudo mkdir -p /opt/android - sudo chown $USER /opt/android - cd /opt/android - git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF - cd cake_wallet/scripts/android/ - ./install_ndk.sh - source ./app_env.sh cakewallet - ./app_config.sh - ./build_all.sh - ./copy_monero_deps.sh - - - name: Install Flutter dependencies - run: | - cd /opt/android/cake_wallet - flutter pub get - - - name: Generate KeyStore - run: | - cd /opt/android/cake_wallet/android/app - keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass ${{ secrets.STORE_PASS }} -keypass ${{ secrets.KEY_PASS }} - - - name: Generate key properties - run: | - cd /opt/android/cake_wallet - flutter packages pub run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=${{ secrets.STORE_PASS }} keyPassword=${{ secrets.KEY_PASS }} - - - name: Generate localization - run: | - cd /opt/android/cake_wallet - flutter packages pub run tool/generate_localization.dart - - - name: Build generated code - run: | - cd /opt/android/cake_wallet - cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. - cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. - cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. - cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. - flutter packages pub run build_runner build --delete-conflicting-outputs - - - name: Add secrets - run: | - cd /opt/android/cake_wallet - touch lib/.secrets.g.dart - echo "const salt = '${{ secrets.SALT }}';" > lib/.secrets.g.dart - echo "const keychainSalt = '${{ secrets.KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart - echo "const key = '${{ secrets.KEY }}';" >> lib/.secrets.g.dart - echo "const walletSalt = '${{ secrets.WALLET_SALT }}';" >> lib/.secrets.g.dart - echo "const shortKey = '${{ secrets.SHORT_KEY }}';" >> lib/.secrets.g.dart - echo "const backupSalt = '${{ secrets.BACKUP_SALT }}';" >> lib/.secrets.g.dart - echo "const backupKeychainSalt = '${{ secrets.BACKUP_KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart - echo "const changeNowApiKey = '${{ secrets.CHANGE_NOW_API_KEY }}';" >> lib/.secrets.g.dart - echo "const wyreSecretKey = '${{ secrets.WYRE_SECRET_KEY }}';" >> lib/.secrets.g.dart - echo "const wyreApiKey = '${{ secrets.WYRE_API_KEY }}';" >> lib/.secrets.g.dart - echo "const wyreAccountId = '${{ secrets.WYRE_ACCOUNT_ID }}';" >> lib/.secrets.g.dart - echo "const moonPayApiKey = '${{ secrets.MOON_PAY_API_KEY }}';" >> lib/.secrets.g.dart - echo "const moonPaySecretKey = '${{ secrets.MOON_PAY_SECRET_KEY }}';" >> lib/.secrets.g.dart - echo "const sideShiftAffiliateId = '${{ secrets.SIDE_SHIFT_AFFILIATE_ID }}';" >> lib/.secrets.g.dart - echo "const sideShiftApiKey = '${{ secrets.SIDE_SHIFT_API_KEY }}';" >> lib/.secrets.g.dart - echo "const simpleSwapApiKey = '${{ secrets.SIMPLE_SWAP_API_KEY }}';" >> lib/.secrets.g.dart - echo "const onramperApiKey = '${{ secrets.ONRAMPER_API_KEY }}';" >> lib/.secrets.g.dart - echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart - echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart - - - name: Build - run: | - cd /opt/android/cake_wallet - flutter build apk --release +# - uses: actions/setup-java@v1 +# with: +# java-version: '8.x' +# +# - name: Flutter action +# uses: subosito/flutter-action@v1 +# with: +# flutter-version: '3.3.x' +# channel: stable +# +# - name: Install package dependencies +# run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang +# +# - name: Execute Build and Setup Commands +# run: | +# sudo mkdir -p /opt/android +# sudo chown $USER /opt/android +# cd /opt/android +# git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF +# cd cake_wallet/scripts/android/ +# ./install_ndk.sh +# source ./app_env.sh cakewallet +# ./app_config.sh +# ./build_all.sh +# ./copy_monero_deps.sh +# +# - name: Install Flutter dependencies +# run: | +# cd /opt/android/cake_wallet +# flutter pub get +# +# - name: Generate KeyStore +# run: | +# cd /opt/android/cake_wallet/android/app +# keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass ${{ secrets.STORE_PASS }} -keypass ${{ secrets.KEY_PASS }} +# +# - name: Generate key properties +# run: | +# cd /opt/android/cake_wallet +# flutter packages pub run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=${{ secrets.STORE_PASS }} keyPassword=${{ secrets.KEY_PASS }} +# +# - name: Generate localization +# run: | +# cd /opt/android/cake_wallet +# flutter packages pub run tool/generate_localization.dart +# +# - name: Build generated code +# run: | +# cd /opt/android/cake_wallet +# cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +# cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +# cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +# cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +# flutter packages pub run build_runner build --delete-conflicting-outputs +# +# - name: Add secrets +# run: | +# cd /opt/android/cake_wallet +# touch lib/.secrets.g.dart +# echo "const salt = '${{ secrets.SALT }}';" > lib/.secrets.g.dart +# echo "const keychainSalt = '${{ secrets.KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart +# echo "const key = '${{ secrets.KEY }}';" >> lib/.secrets.g.dart +# echo "const walletSalt = '${{ secrets.WALLET_SALT }}';" >> lib/.secrets.g.dart +# echo "const shortKey = '${{ secrets.SHORT_KEY }}';" >> lib/.secrets.g.dart +# echo "const backupSalt = '${{ secrets.BACKUP_SALT }}';" >> lib/.secrets.g.dart +# echo "const backupKeychainSalt = '${{ secrets.BACKUP_KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart +# echo "const changeNowApiKey = '${{ secrets.CHANGE_NOW_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const wyreSecretKey = '${{ secrets.WYRE_SECRET_KEY }}';" >> lib/.secrets.g.dart +# echo "const wyreApiKey = '${{ secrets.WYRE_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const wyreAccountId = '${{ secrets.WYRE_ACCOUNT_ID }}';" >> lib/.secrets.g.dart +# echo "const moonPayApiKey = '${{ secrets.MOON_PAY_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const moonPaySecretKey = '${{ secrets.MOON_PAY_SECRET_KEY }}';" >> lib/.secrets.g.dart +# echo "const sideShiftAffiliateId = '${{ secrets.SIDE_SHIFT_AFFILIATE_ID }}';" >> lib/.secrets.g.dart +# echo "const sideShiftApiKey = '${{ secrets.SIDE_SHIFT_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const simpleSwapApiKey = '${{ secrets.SIMPLE_SWAP_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const onramperApiKey = '${{ secrets.ONRAMPER_API_KEY }}';" >> lib/.secrets.g.dart +# echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart +# echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart +# +# - name: Build +# run: | +# cd /opt/android/cake_wallet +# flutter build apk --release # - name: Push to App Center # run: | @@ -108,9 +108,26 @@ jobs: # --token ${{ secrets.APP_CENTER_TOKEN }} \ # --quiet +# - name: Send Test APK +# run: | +# cd /opt/android/cake_wallet +# var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/app-release.apk) +# curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' + + - name: Send Test APK run: | - cd /opt/android/cake_wallet - var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/app-release.apk) + var=$(curl --upload-file pubspec_base.yaml https://transfer.sh/$GITHUB_HEAD_REF.apk) curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' + - name: Rename apk + - run: | + mv pubspec_base.yaml $GITHUB_HEAD_REF.apk + ls + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: test-apks-artifacts + path: $GITHUB_HEAD_REF.apk + From b70838a308d7f3c9ef209ef7a1f3cc2245737297 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:16:04 +0200 Subject: [PATCH 02/19] Upload APK to github artifacts Rename apk --- .github/workflows/pr_test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 398f1edd5..cdab77afb 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -121,7 +121,7 @@ jobs: curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - name: Rename apk - - run: | + run: | mv pubspec_base.yaml $GITHUB_HEAD_REF.apk ls From b62e4cb0648a0014b5fbd339f52c06d03cae1ea8 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:19:43 +0200 Subject: [PATCH 03/19] fix artifact path --- .github/workflows/pr_test_build.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index cdab77afb..e016cbf8f 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -111,15 +111,9 @@ jobs: # - name: Send Test APK # run: | # cd /opt/android/cake_wallet -# var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/app-release.apk) +# var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk) # curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - - - name: Send Test APK - run: | - var=$(curl --upload-file pubspec_base.yaml https://transfer.sh/$GITHUB_HEAD_REF.apk) - curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - - name: Rename apk run: | mv pubspec_base.yaml $GITHUB_HEAD_REF.apk @@ -129,5 +123,5 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: $GITHUB_HEAD_REF.apk + path: "\${{GITHUB_HEAD_REF}}.apk" From fb2e7306ad5949497e286f829297796d3f7deb5c Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:23:58 +0200 Subject: [PATCH 04/19] fix artifact path --- .github/workflows/pr_test_build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index e016cbf8f..d09b938b3 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -116,12 +116,13 @@ jobs: - name: Rename apk run: | - mv pubspec_base.yaml $GITHUB_HEAD_REF.apk + mkdir test-apk + mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk ls - name: Upload Artifact uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: "\${{GITHUB_HEAD_REF}}.apk" + path: test-apk/* From 28f1afd972b1dcab96a5ff76ffdbafe91f2ec17d Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:26:39 +0200 Subject: [PATCH 05/19] try different file --- .github/workflows/pr_test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index d09b938b3..71c8a6d0e 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -117,7 +117,7 @@ jobs: - name: Rename apk run: | mkdir test-apk - mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk + mv pubspec_base.yaml test-apk/second-test.apk ls - name: Upload Artifact From 9b20af929204cb6cb0913ccfa101ef14c59cb4ca Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:33:09 +0200 Subject: [PATCH 06/19] try different file --- .github/workflows/pr_test_build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 71c8a6d0e..b2639e5e7 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -114,15 +114,22 @@ jobs: # var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk) # curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' +# - name: Rename apk +# run: | +# cd /opt/android/cake_wallet/build/app/outputs/apk/release +# mkdir test-apk +# mv app-release.apk test-apk/$GITHUB_HEAD_REF.apk + - name: Rename apk run: | mkdir test-apk - mv pubspec_base.yaml test-apk/second-test.apk + mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk + cd test-apk ls - name: Upload Artifact uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: test-apk/* + path: test-apk/"$GITHUB_HEAD_REF".apk From 1198b164556380c8b63e1f011d2afc61ecbf877d Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:37:56 +0200 Subject: [PATCH 07/19] Try uploading single apk file --- .github/workflows/pr_test_build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index b2639e5e7..595ff3def 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -126,10 +126,22 @@ jobs: mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk cd test-apk ls + apkPath=pwd/$GITHUB_HEAD_REF.apk + echo "====================" + echo apkPath + echo "====================" - name: Upload Artifact + continue-on-error: true uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: test-apk/"$GITHUB_HEAD_REF".apk + path: apkPath + + - name: Upload Artifact + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: test-apks-artifacts + path: $apkPath From 0c8636a77856f93b2c901abcce7367c6b452a691 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:46:03 +0200 Subject: [PATCH 08/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 595ff3def..01895c1fb 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -128,20 +128,30 @@ jobs: ls apkPath=pwd/$GITHUB_HEAD_REF.apk echo "====================" - echo apkPath + echo $apkPath echo "====================" + echo "artifactPath=test-apk/${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV + echo ${{ env.artifactPath }} - name: Upload Artifact continue-on-error: true uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: apkPath + path: test-apk/${{ GITHUB_HEAD_REF }}.apk - name: Upload Artifact continue-on-error: true uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: $apkPath + path: ${{ apkPath }} + + - name: Upload Artifact + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: test-apks-artifacts + path: ${{ env.artifactPath }} + retention-days: 30 From e78ef3c201a385b0fb40e478cf9444b74e93bfda Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:48:01 +0200 Subject: [PATCH 09/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 01895c1fb..8a8760aad 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -126,7 +126,7 @@ jobs: mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk cd test-apk ls - apkPath=pwd/$GITHUB_HEAD_REF.apk + apkPath=pwd/${{ GITHUB_HEAD_REF }}.apk echo "====================" echo $apkPath echo "====================" From 12f4b9339c1659711137e9b2a4b59757a7b63f82 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:50:46 +0200 Subject: [PATCH 10/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 8a8760aad..818b0b8c9 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -126,12 +126,16 @@ jobs: mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk cd test-apk ls - apkPath=pwd/${{ GITHUB_HEAD_REF }}.apk + apkPath=pwd/$GITHUB_HEAD_REF.apk echo "====================" echo $apkPath echo "====================" - echo "artifactPath=test-apk/${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV + echo "artifactPath=test-apk/$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV + echo "artifactPath2=test-apk/\$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV + echo "artifactPath3=test-apk/\${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV echo ${{ env.artifactPath }} + echo ${{ env.artifactPath2 }} + echo ${{ env.artifactPath3 }} - name: Upload Artifact continue-on-error: true @@ -153,5 +157,21 @@ jobs: with: name: test-apks-artifacts path: ${{ env.artifactPath }} - retention-days: 30 + retention-days: 1 + + - name: Upload Artifact + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: test-apks-artifacts + path: ${{ env.artifactPath2 }} + retention-days: 1 + + - name: Upload Artifact + continue-on-error: true + uses: actions/upload-artifact@v3 + with: + name: test-apks-artifacts + path: ${{ env.artifactPath3 }} + retention-days: 1 From 71989cf6d79e977d772d55b8b5c232db824ef83b Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:52:04 +0200 Subject: [PATCH 11/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 818b0b8c9..f1dae682b 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -142,7 +142,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-apks-artifacts - path: test-apk/${{ GITHUB_HEAD_REF }}.apk + path: test-apk/${{ $GITHUB_HEAD_REF }}.apk - name: Upload Artifact continue-on-error: true From 8daf20753bd9ad9ff60bb70addb494188d29620c Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:52:33 +0200 Subject: [PATCH 12/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index f1dae682b..523f70725 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -137,13 +137,6 @@ jobs: echo ${{ env.artifactPath2 }} echo ${{ env.artifactPath3 }} - - name: Upload Artifact - continue-on-error: true - uses: actions/upload-artifact@v3 - with: - name: test-apks-artifacts - path: test-apk/${{ $GITHUB_HEAD_REF }}.apk - - name: Upload Artifact continue-on-error: true uses: actions/upload-artifact@v3 From 903cd7bf6f10c922765b42f29cd961500b6aef04 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:53:15 +0200 Subject: [PATCH 13/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 523f70725..d9509e813 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -137,13 +137,6 @@ jobs: echo ${{ env.artifactPath2 }} echo ${{ env.artifactPath3 }} - - name: Upload Artifact - continue-on-error: true - uses: actions/upload-artifact@v3 - with: - name: test-apks-artifacts - path: ${{ apkPath }} - - name: Upload Artifact continue-on-error: true uses: actions/upload-artifact@v3 From e516bd7a07e6b55ad389cede51dafcb0ce842912 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:55:29 +0200 Subject: [PATCH 14/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index d9509e813..9e9393ed9 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -131,11 +131,11 @@ jobs: echo $apkPath echo "====================" echo "artifactPath=test-apk/$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV - echo "artifactPath2=test-apk/\$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV - echo "artifactPath3=test-apk/\${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV +# echo "artifactPath2=test-apk/\$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV +# echo "artifactPath3=test-apk/\${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV echo ${{ env.artifactPath }} - echo ${{ env.artifactPath2 }} - echo ${{ env.artifactPath3 }} +# echo ${{ env.artifactPath2 }} +# echo ${{ env.artifactPath3 }} - name: Upload Artifact continue-on-error: true @@ -145,19 +145,19 @@ jobs: path: ${{ env.artifactPath }} retention-days: 1 - - name: Upload Artifact - continue-on-error: true - uses: actions/upload-artifact@v3 - with: - name: test-apks-artifacts - path: ${{ env.artifactPath2 }} - retention-days: 1 - - - name: Upload Artifact - continue-on-error: true - uses: actions/upload-artifact@v3 - with: - name: test-apks-artifacts - path: ${{ env.artifactPath3 }} - retention-days: 1 +# - name: Upload Artifact +# continue-on-error: true +# uses: actions/upload-artifact@v3 +# with: +# name: test-apks-artifacts +# path: ${{ env.artifactPath2 }} +# retention-days: 1 +# +# - name: Upload Artifact +# continue-on-error: true +# uses: actions/upload-artifact@v3 +# with: +# name: test-apks-artifacts +# path: ${{ env.artifactPath3 }} +# retention-days: 1 From bd1a5cf3f7733a1cf426f40364346d213a2e3ef7 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 14:56:27 +0200 Subject: [PATCH 15/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 9e9393ed9..0304171b8 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -131,11 +131,7 @@ jobs: echo $apkPath echo "====================" echo "artifactPath=test-apk/$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV -# echo "artifactPath2=test-apk/\$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV -# echo "artifactPath3=test-apk/\${{ GITHUB_HEAD_REF.apk }}" >> $GITHUB_ENV echo ${{ env.artifactPath }} -# echo ${{ env.artifactPath2 }} -# echo ${{ env.artifactPath3 }} - name: Upload Artifact continue-on-error: true From 5364dd87107c8699690a25bd394a171bedb550de Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 15:01:20 +0200 Subject: [PATCH 16/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 0304171b8..5121be130 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -135,11 +135,9 @@ jobs: - name: Upload Artifact continue-on-error: true - uses: actions/upload-artifact@v3 + uses: kittaakos/upload-artifact-as-is@v0 with: - name: test-apks-artifacts - path: ${{ env.artifactPath }} - retention-days: 1 + path: test-apk/ # - name: Upload Artifact # continue-on-error: true From e264cb326db4f75dbd764d8fcd2c5978ca270592 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 15:15:56 +0200 Subject: [PATCH 17/19] Try uploading renamed apk file --- .github/workflows/pr_test_build.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 5121be130..8b038687b 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -124,34 +124,8 @@ jobs: run: | mkdir test-apk mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk - cd test-apk - ls - apkPath=pwd/$GITHUB_HEAD_REF.apk - echo "====================" - echo $apkPath - echo "====================" - echo "artifactPath=test-apk/$GITHUB_HEAD_REF.apk" >> $GITHUB_ENV - echo ${{ env.artifactPath }} - name: Upload Artifact - continue-on-error: true uses: kittaakos/upload-artifact-as-is@v0 with: path: test-apk/ - -# - name: Upload Artifact -# continue-on-error: true -# uses: actions/upload-artifact@v3 -# with: -# name: test-apks-artifacts -# path: ${{ env.artifactPath2 }} -# retention-days: 1 -# -# - name: Upload Artifact -# continue-on-error: true -# uses: actions/upload-artifact@v3 -# with: -# name: test-apks-artifacts -# path: ${{ env.artifactPath3 }} -# retention-days: 1 - From d38b3b0e0675a8c3e1dadef067981298c111c283 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 15:19:51 +0200 Subject: [PATCH 18/19] Finalize upload to artifacts and renaming --- .github/workflows/pr_test_build.yml | 187 ++++++++++++++-------------- 1 file changed, 91 insertions(+), 96 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 8b038687b..5611fe578 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -11,89 +11,89 @@ jobs: steps: - uses: actions/checkout@v2 -# - uses: actions/setup-java@v1 -# with: -# java-version: '8.x' -# -# - name: Flutter action -# uses: subosito/flutter-action@v1 -# with: -# flutter-version: '3.3.x' -# channel: stable -# -# - name: Install package dependencies -# run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang -# -# - name: Execute Build and Setup Commands -# run: | -# sudo mkdir -p /opt/android -# sudo chown $USER /opt/android -# cd /opt/android -# git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF -# cd cake_wallet/scripts/android/ -# ./install_ndk.sh -# source ./app_env.sh cakewallet -# ./app_config.sh -# ./build_all.sh -# ./copy_monero_deps.sh -# -# - name: Install Flutter dependencies -# run: | -# cd /opt/android/cake_wallet -# flutter pub get -# -# - name: Generate KeyStore -# run: | -# cd /opt/android/cake_wallet/android/app -# keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass ${{ secrets.STORE_PASS }} -keypass ${{ secrets.KEY_PASS }} -# -# - name: Generate key properties -# run: | -# cd /opt/android/cake_wallet -# flutter packages pub run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=${{ secrets.STORE_PASS }} keyPassword=${{ secrets.KEY_PASS }} -# -# - name: Generate localization -# run: | -# cd /opt/android/cake_wallet -# flutter packages pub run tool/generate_localization.dart -# -# - name: Build generated code -# run: | -# cd /opt/android/cake_wallet -# cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -# cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -# cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -# cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -# flutter packages pub run build_runner build --delete-conflicting-outputs -# -# - name: Add secrets -# run: | -# cd /opt/android/cake_wallet -# touch lib/.secrets.g.dart -# echo "const salt = '${{ secrets.SALT }}';" > lib/.secrets.g.dart -# echo "const keychainSalt = '${{ secrets.KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart -# echo "const key = '${{ secrets.KEY }}';" >> lib/.secrets.g.dart -# echo "const walletSalt = '${{ secrets.WALLET_SALT }}';" >> lib/.secrets.g.dart -# echo "const shortKey = '${{ secrets.SHORT_KEY }}';" >> lib/.secrets.g.dart -# echo "const backupSalt = '${{ secrets.BACKUP_SALT }}';" >> lib/.secrets.g.dart -# echo "const backupKeychainSalt = '${{ secrets.BACKUP_KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart -# echo "const changeNowApiKey = '${{ secrets.CHANGE_NOW_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const wyreSecretKey = '${{ secrets.WYRE_SECRET_KEY }}';" >> lib/.secrets.g.dart -# echo "const wyreApiKey = '${{ secrets.WYRE_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const wyreAccountId = '${{ secrets.WYRE_ACCOUNT_ID }}';" >> lib/.secrets.g.dart -# echo "const moonPayApiKey = '${{ secrets.MOON_PAY_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const moonPaySecretKey = '${{ secrets.MOON_PAY_SECRET_KEY }}';" >> lib/.secrets.g.dart -# echo "const sideShiftAffiliateId = '${{ secrets.SIDE_SHIFT_AFFILIATE_ID }}';" >> lib/.secrets.g.dart -# echo "const sideShiftApiKey = '${{ secrets.SIDE_SHIFT_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const simpleSwapApiKey = '${{ secrets.SIMPLE_SWAP_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const onramperApiKey = '${{ secrets.ONRAMPER_API_KEY }}';" >> lib/.secrets.g.dart -# echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart -# echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart -# -# - name: Build -# run: | -# cd /opt/android/cake_wallet -# flutter build apk --release + - uses: actions/setup-java@v1 + with: + java-version: '8.x' + + - name: Flutter action + uses: subosito/flutter-action@v1 + with: + flutter-version: '3.3.x' + channel: stable + + - name: Install package dependencies + run: sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang + + - name: Execute Build and Setup Commands + run: | + sudo mkdir -p /opt/android + sudo chown $USER /opt/android + cd /opt/android + git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF + cd cake_wallet/scripts/android/ + ./install_ndk.sh + source ./app_env.sh cakewallet + ./app_config.sh + ./build_all.sh + ./copy_monero_deps.sh + + - name: Install Flutter dependencies + run: | + cd /opt/android/cake_wallet + flutter pub get + + - name: Generate KeyStore + run: | + cd /opt/android/cake_wallet/android/app + keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass ${{ secrets.STORE_PASS }} -keypass ${{ secrets.KEY_PASS }} + + - name: Generate key properties + run: | + cd /opt/android/cake_wallet + flutter packages pub run tool/generate_android_key_properties.dart keyAlias=testKey storeFile=key.jks storePassword=${{ secrets.STORE_PASS }} keyPassword=${{ secrets.KEY_PASS }} + + - name: Generate localization + run: | + cd /opt/android/cake_wallet + flutter packages pub run tool/generate_localization.dart + + - name: Build generated code + run: | + cd /opt/android/cake_wallet + cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. + cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. + cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. + cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. + flutter packages pub run build_runner build --delete-conflicting-outputs + + - name: Add secrets + run: | + cd /opt/android/cake_wallet + touch lib/.secrets.g.dart + echo "const salt = '${{ secrets.SALT }}';" > lib/.secrets.g.dart + echo "const keychainSalt = '${{ secrets.KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart + echo "const key = '${{ secrets.KEY }}';" >> lib/.secrets.g.dart + echo "const walletSalt = '${{ secrets.WALLET_SALT }}';" >> lib/.secrets.g.dart + echo "const shortKey = '${{ secrets.SHORT_KEY }}';" >> lib/.secrets.g.dart + echo "const backupSalt = '${{ secrets.BACKUP_SALT }}';" >> lib/.secrets.g.dart + echo "const backupKeychainSalt = '${{ secrets.BACKUP_KEY_CHAIN_SALT }}';" >> lib/.secrets.g.dart + echo "const changeNowApiKey = '${{ secrets.CHANGE_NOW_API_KEY }}';" >> lib/.secrets.g.dart + echo "const wyreSecretKey = '${{ secrets.WYRE_SECRET_KEY }}';" >> lib/.secrets.g.dart + echo "const wyreApiKey = '${{ secrets.WYRE_API_KEY }}';" >> lib/.secrets.g.dart + echo "const wyreAccountId = '${{ secrets.WYRE_ACCOUNT_ID }}';" >> lib/.secrets.g.dart + echo "const moonPayApiKey = '${{ secrets.MOON_PAY_API_KEY }}';" >> lib/.secrets.g.dart + echo "const moonPaySecretKey = '${{ secrets.MOON_PAY_SECRET_KEY }}';" >> lib/.secrets.g.dart + echo "const sideShiftAffiliateId = '${{ secrets.SIDE_SHIFT_AFFILIATE_ID }}';" >> lib/.secrets.g.dart + echo "const sideShiftApiKey = '${{ secrets.SIDE_SHIFT_API_KEY }}';" >> lib/.secrets.g.dart + echo "const simpleSwapApiKey = '${{ secrets.SIMPLE_SWAP_API_KEY }}';" >> lib/.secrets.g.dart + echo "const onramperApiKey = '${{ secrets.ONRAMPER_API_KEY }}';" >> lib/.secrets.g.dart + echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart + echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart + + - name: Build + run: | + cd /opt/android/cake_wallet + flutter build apk --release # - name: Push to App Center # run: | @@ -108,24 +108,19 @@ jobs: # --token ${{ secrets.APP_CENTER_TOKEN }} \ # --quiet -# - name: Send Test APK -# run: | -# cd /opt/android/cake_wallet -# var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk) -# curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - -# - name: Rename apk -# run: | -# cd /opt/android/cake_wallet/build/app/outputs/apk/release -# mkdir test-apk -# mv app-release.apk test-apk/$GITHUB_HEAD_REF.apk + - name: Send Test APK + run: | + cd /opt/android/cake_wallet + var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk) + curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - name: Rename apk run: | + cd /opt/android/cake_wallet/build/app/outputs/apk/release mkdir test-apk - mv pubspec_base.yaml test-apk/$GITHUB_HEAD_REF.apk + mv app-release.apk test-apk/$GITHUB_HEAD_REF.apk - name: Upload Artifact uses: kittaakos/upload-artifact-as-is@v0 with: - path: test-apk/ + path: /opt/android/cake_wallet/build/app/outputs/apk/release/test-apk/ From 03a64b16859eb8951de25f66eed9b98787457c61 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Tue, 29 Nov 2022 15:49:24 +0200 Subject: [PATCH 19/19] Rename app and apk to ease testing process --- .github/workflows/pr_test_build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml index 5611fe578..190b891e1 100644 --- a/.github/workflows/pr_test_build.yml +++ b/.github/workflows/pr_test_build.yml @@ -90,6 +90,9 @@ jobs: echo "const anypayToken = '${{ secrets.ANY_PAY_TOKEN }}';" >> lib/.secrets.g.dart echo "const ioniaClientId = '${{ secrets.IONIA_CLIENT_ID }}';" >> lib/.secrets.g.dart + - name: Rename app + run: sed -i -e "s/\${APP_NAME}/$GITHUB_HEAD_REF/g" /opt/android/cake_wallet/android/app/src/main/AndroidManifest.xml + - name: Build run: | cd /opt/android/cake_wallet @@ -111,10 +114,10 @@ jobs: - name: Send Test APK run: | cd /opt/android/cake_wallet - var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk) + var=$(curl --upload-file build/app/outputs/apk/release/app-release.apk https://transfer.sh/$GITHUB_HEAD_REF.apk -H "Max-Days: 10") curl ${{ secrets.SLACK_WEB_HOOK }} -H "Content-Type: application/json" -d '{"apk_link": "'"$var"'","ticket": "'"$GITHUB_HEAD_REF"'"}' - - name: Rename apk + - name: Rename apk file run: | cd /opt/android/cake_wallet/build/app/outputs/apk/release mkdir test-apk