From 827c55576e505203d422624e91bf7a9961df6a4e Mon Sep 17 00:00:00 2001 From: Serge Muhundu <54764431+Sergemuhundu@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:58:02 +0100 Subject: [PATCH 1/2] CI/CD into Google Play Store --- .github/workflows/mobile-prod.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/mobile-prod.yml b/.github/workflows/mobile-prod.yml index a634ea2c6..7999d5311 100644 --- a/.github/workflows/mobile-prod.yml +++ b/.github/workflows/mobile-prod.yml @@ -52,3 +52,6 @@ jobs: - name: Publish update run: cd apps/mobile && eas update --auto + + - name: Upload to Play Store Console + run: cd apps/mobile && eas submit -p android --latest --key ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} From af9d25554cd8565b9791831c91fb11c06440210c Mon Sep 17 00:00:00 2001 From: Ruslan K Date: Thu, 26 Oct 2023 15:40:27 +0200 Subject: [PATCH 2/2] Update mobile-prod.yml --- .github/workflows/mobile-prod.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mobile-prod.yml b/.github/workflows/mobile-prod.yml index 7999d5311..0cb11392b 100644 --- a/.github/workflows/mobile-prod.yml +++ b/.github/workflows/mobile-prod.yml @@ -14,6 +14,8 @@ jobs: deploy: runs-on: ubuntu-latest + environment: prod + permissions: contents: read @@ -53,5 +55,28 @@ jobs: - name: Publish update run: cd apps/mobile && eas update --auto + - name: Decode Google Credentials + run: | + DECODED_GOOGLE_CREDENTIALS=$(echo '${{ secrets.GOOGLE_CREDENTIALS }}' | base64 --decode) + echo "DECODED_GOOGLE_CREDENTIALS=$DECODED_GOOGLE_CREDENTIALS" >> $GITHUB_ENV + echo "::add-mask::$DECODED_GOOGLE_CREDENTIALS" + ESCAPED_GOOGLE_CREDENTIALS=$(echo "$DECODED_GOOGLE_CREDENTIALS" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g') + ESCAPED_GOOGLE_CREDENTIALS=$(echo $ESCAPED_GOOGLE_CREDENTIALS | sed 's/\\n/\\\\n/g') + echo "ESCAPED_GOOGLE_CREDENTIALS=$ESCAPED_GOOGLE_CREDENTIALS" >> $GITHUB_ENV + echo "::add-mask::$ESCAPED_GOOGLE_CREDENTIALS" + + # See https://github.com/ever-co/ever-teams-boards-store/blob/develop/.github/workflows/deploy.yml + + - name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@v1" + with: + credentials_json: ${{ env.DECODED_GOOGLE_CREDENTIALS }} + + # Install gcloud, `setup-gcloud` automatically picks up authentication from `auth`. + - name: "Set up Cloud SDK" + uses: "google-github-actions/setup-gcloud@v1" + with: + project_id: "ever-teams-399720" + - name: Upload to Play Store Console - run: cd apps/mobile && eas submit -p android --latest --key ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} + run: cd apps/mobile && eas submit -p android --latest --key ${{ secrets.GOOGLE_CREDENTIALS }}