-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: upload to firebase app distribution + run unittests on each commit (
#68) ADD CI firebase upload ADD CI unittests
- Loading branch information
Showing
7 changed files
with
121 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Prepare All | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
prepare-all: | ||
runs-on: macos-latest # use [ self-hosted, macOS ] to host on our own mac mini, which is twice as fast and cheaper than hosting on a github runner. See README for more info. | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
java-version: "21" # keep the same as your Android Studio version | ||
cache: "gradle" | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
prepareRelease: | ||
runs-on: macos-latest # use [ self-hosted, macOS ] to host on our own mac mini, which is twice as fast and cheaper than hosting on a github runner. See README for more info. | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Update Version Code # we increase the version code with each build | ||
uses: chkfung/[email protected] | ||
with: | ||
gradlePath: app/build.gradle | ||
versionCode: ${{ github.run_number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release Builds | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ 'develop' ] | ||
|
||
jobs: | ||
prepare-all: | ||
uses: ./.github/workflows/_prepare-all.yml | ||
prepare-release: | ||
uses: ./.github/workflows/_prepare-release.yml | ||
build: | ||
runs-on: macos-latest # use [ self-hosted, macOS ] to host on our own mac mini, which is twice as fast and cheaper than hosting on a github runner. See README for more info. | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# This will decode the keystore from base 64 text representation that we have stored in secrets | ||
# and generates and keystore file and gets stored in /android-app path | ||
- name: Decode Keystore | ||
env: | ||
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} | ||
shell: bash | ||
run: | | ||
echo $ENCODED_STRING > keystore-b64.txt | ||
base64 -d <keystore-b64.txt >upload-keystore.jks | ||
- name: Build Prod Release APK | ||
env: | ||
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | ||
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | ||
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | ||
run: ./gradlew assembleProdRelease --stacktrace | ||
|
||
- name: Upload Release APK to Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.run_number }}-prod-release-apk | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/apk/prod/release/app-prod-release.apk | ||
- name: Upload Prod Release APK to Firebase App Distribution | ||
uses: nickwph/firebase-app-distribution-action@v1 | ||
with: | ||
file: ${{ github.workspace }}/app/build/outputs/apk/prod/release/app-prod-release.apk | ||
app: ${{ secrets.FIREBASE_PROD_APP_ID }} | ||
credentials: ${{ secrets.FIREBASE_CREDENTIALS }} | ||
|
||
- name: Build Prod Release Bundle | ||
env: | ||
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | ||
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | ||
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | ||
run: ./gradlew bundleProdRelease --stacktrace | ||
|
||
- name: Upload Release Bundle to Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.run_number }}-prod-release-bundle | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/bundle/prodRelease/app-prod-release.aab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,21 @@ on: | |
branches: [ '*' ] # run on all pull requests | ||
|
||
jobs: | ||
prepare-all: | ||
uses: ./.github/workflows/_prepare-all.yml | ||
prepare-release: | ||
uses: ./.github/workflows/_prepare-release.yml | ||
build: | ||
runs-on: macos-latest # use [ self-hosted, macOS ] to host on our own mac mini, which is twice as fast and cheaper than hosting on a github runner. See README for more info. | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Prepare build | ||
uses: ./.github/workflows/scripts/prepare | ||
|
||
- name: Update Version Code # we increase the version code with each build | ||
uses: chkfung/[email protected] | ||
with: | ||
gradlePath: app/build.gradle | ||
versionCode: ${{ github.run_number }} | ||
|
||
# This will decode the keystore from base 64 text representation that we have stored in secrets | ||
# and generates and keystore file and gets stored in /android-app path | ||
- name: Decode Keystore | ||
env: | ||
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} | ||
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | ||
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | ||
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | ||
|
||
shell: bash | ||
run: | | ||
echo $ENCODED_STRING > keystore-b64.txt | ||
base64 -d <keystore-b64.txt >upload-keystore.jks | ||
|
@@ -45,17 +38,3 @@ jobs: | |
name: ${{ github.event.repository.name }}-${{ github.run_number }}-prod-release-apk | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/apk/prod/release/app-prod-release.apk | ||
- name: Build Prod Release Bundle | ||
env: | ||
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | ||
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | ||
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | ||
run: ./gradlew bundleProdRelease --stacktrace | ||
|
||
- name: Upload Release Bundle to Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.run_number }}-prod-release-bundle | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/bundle/prodRelease/app-prod-release.aab |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters