-
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.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 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,63 @@ | ||
name: Android Build & Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up ruby env | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.2 | ||
bundler-cache: true | ||
|
||
- name: Run tests | ||
run: bundle exec fastlane android test | ||
|
||
- name: Decode Service Account Key JSON File | ||
uses: timheuer/base64-to-file@v1 | ||
id: service_account_json_file | ||
with: | ||
fileName: "serviceAccount.json" | ||
encodedString: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} | ||
|
||
- name: Decode Keystore File | ||
uses: timheuer/base64-to-file@v1 | ||
id: android_keystore | ||
with: | ||
fileName: "android_keystore.keystore" | ||
encodedString: ${{ secrets.KEYSTORE_FILE }} | ||
|
||
- name: Define version code with offset | ||
env: | ||
RUN_NUMBER: ${{ github.run_number }} | ||
INITIAL_VERSION_CODE: 27 | ||
run: | | ||
VERSION_CODE=$((INITIAL_VERSION_CODE + RUN_NUMBER)) | ||
echo "version_code=$VERSION_CODE" >> $GITHUB_ENV | ||
- name: Update version code | ||
uses: chkfung/[email protected] | ||
with: | ||
gradlePath: android/app/build.gradle | ||
versionCode: ${{ env.version_code }} | ||
|
||
- name: Build & deploy Android release | ||
run: bundle exec fastlane android deploy | ||
env: | ||
KEYSTORE_FILE: ${{ steps.android_keystore.outputs.filePath }} | ||
STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
KEY_ALIAS: ${{ secrets.KEY_ALIAS}} | ||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }} | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: assets | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/bundle/release |