Skip to content

Commit

Permalink
chore(pipeline): use google-service-account.json
Browse files Browse the repository at this point in the history
SUITEDEV-35237

Co-authored-by: davidSchuppa <[email protected]>
  • Loading branch information
LasOri and davidSchuppa committed Mar 1, 2024
1 parent 96779c1 commit 9c23d5f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/on_push_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
FIREBASE_SERVICE_ACCOUNT_JSON: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
GOOGLE_OAUTH_SERVER_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_SERVER_CLIENT_ID }}
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64 }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release_sample_app_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
FIREBASE_SERVICE_ACCOUNT_JSON: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
GOOGLE_OAUTH_SERVER_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_SERVER_CLIENT_ID }}
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64 }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
Expand Down Expand Up @@ -52,16 +53,16 @@ jobs:
- name: Prepare CI
run: make prepare-ci

- name: Prepare keystore file
run: make base64-secret-to-file SECRET=ANDROID_RELEASE_STORE_FILE_BASE64 FILE=sample/mobile-team-android.jks
- name: Prepare sample release
run: make prepare-sample-release

- name: Create sample app release bundle
run: ./gradlew :sample:bundleRelease

- name: PlayStore upload
uses: r0adkll/[email protected]
with:
serviceAccountJson: ./sample/google-services.json
serviceAccountJson: ./sample/google-play-store-service-account.json
packageName: com.emarsys.sample
releaseFile: sample/build/outputs/bundle/release/sample-release.aab
track: alpha
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: base64-secret-to-file build-test check-env help create-sample-release-bundle create-testing-apks lint prepare-ci run-github-workflow-locally test-android-firebase test-android-firebase-emulator release-to-sonatype
.PHONY: base64-secret-to-file build-test check-env help create-sample-release-bundle create-testing-apks lint prepare-ci run-github-workflow-locally test-android-firebase test-android-firebase-emulator release-to-sonatype prepare-sample-release
.DEFAULT_GOAL := help
SHELL := /bin/bash

Expand Down Expand Up @@ -48,7 +48,9 @@ prepare-ci: check-env ## setup prerequisites for pipeline
prepare-release: check-env ## setup prerequisites for release
@./gradlew base64EnvToFile -PpropertyName=SONATYPE_SIGNING_SECRET_KEY_RING_FILE_BASE64 -Pfile=./secring.asc.gpg

prepare-sample-release-key: check-env
prepare-sample-release: check-env ## prepares .jks file for sample release
@./gradlew base64EnvToFile -PpropertyName=ANDROID_RELEASE_STORE_FILE_BASE64 -Pfile=sample/mobile-team-android.jks \
@./gradlew base64EnvToFile -PpropertyName=GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON_BASE64 -Pfile=sample/google-play-store-service-account.json

test-android-firebase-emulator: check-env ## run Android Instrumented tests on emulators on Firebase Test Lab
@gcloud firebase test android run \
Expand All @@ -74,7 +76,7 @@ test-android-firebase: check-env ## run Android Instrumented tests on real devic
run-github-workflow-locally: check-env ## needs act to be installed: `brew install act` and docker running. Pass in workflow path to run
@act --secret-file ./workflow.secrets -W $(WORKFLOW_PATH) --container-architecture linux/amd64

release: check-env prepare-release prepare-sample-release-key ## release to sonatype
release: check-env prepare-release prepare-sample-release ## release to sonatype
@./gradlew assembleRelease && ./gradlew publishToSonatype
release-locally: check-env prepare-release prepare-sample-release-key ## release to mavenLocal
release-locally: check-env prepare-release prepare-sample-release ## release to mavenLocal
@./gradlew assembleRelease && ./gradlew publishToMavenLocal

0 comments on commit 9c23d5f

Please sign in to comment.