Deploy to Firebase #156
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
name: Deploy to Firebase | |
on: | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
FIREBASE_APP_ID: | |
required: true | |
FIREBASE_APP_ID_INTERNAL: | |
required: true | |
FIREBASE_CLI_TOKEN: | |
required: true | |
# Token must have read access to all the submodule repositories | |
GH_MOBILE_PAT: | |
required: true | |
env: | |
INITIAL_VERSION_CODE: ${{ 1000 }} | |
jobs: | |
build: | |
name: Upload apk to Firebase | |
runs-on: [self-hosted, old] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
token: ${{ secrets.GH_MOBILE_PAT }} | |
- name: set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
- name: Increment version code | |
env: | |
RUN_NUMBER: ${{ github.run_number }} | |
run: | | |
echo "VERSION_CODE=$((RUN_NUMBER + $INITIAL_VERSION_CODE))" >> $GITHUB_ENV | |
- name: Read version.properties file | |
uses: BrycensRanch/read-properties-action@v1 | |
id: version | |
with: | |
file: version.properties | |
property: versionName | |
default: 0.0.1 | |
- name: Bundle install | |
run: | | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: Build and upload | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
app_id_internal: ${{secrets.FIREBASE_APP_ID_INTERNAL}} | |
apk_path_internal: app/build/outputs/apk/internal/app-internal.apk | |
versionCode: ${{ env.VERSION_CODE }} | |
versionName: ${{ steps.version.outputs.versionName }} | |
releaseNotes: ${{ github.ref_name }} - ${{ github.sha }} | |
groups: testers | |
run: | | |
bundle exec fastlane publishToFirebase |