Skip to content

Instantly share code, notes, and snippets.

@premacck
Last active January 16, 2021 18:47
Show Gist options
  • Save premacck/492347220757bf746858d4795570ca95 to your computer and use it in GitHub Desktop.
Save premacck/492347220757bf746858d4795570ca95 to your computer and use it in GitHub Desktop.
Release workflow to run on push to `main` branch, which builds release & debug apps and uploads both to firebase app distribution, and notify Teams channel
name: Push on main branch
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Release-Pipeline:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set Secret Properties
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
run: echo "$LOCAL_PROPERTIES" > ./local.properties
- name: Prepare release keystore
run: |
echo "${{ secrets.BASE_64_SIGNING_KEY }}" > signing_config.jks.asc
gpg -d --passphrase "${{ secrets.BASE_64_SIGNING_KEY_PASSPHRASE }}" --batch signing_config.jks.asc > app/signing_config.jks
- name: Build with Gradle
env:
VERSION_CODE: ${{ github.run_number }}
run: ./gradlew build
- name: Build release distribution
env:
VERSION_CODE: ${{ github.run_number }}
run: ./gradlew assembleRelease
- name: List files
run: ls -lrt app/build/outputs/apk/release
- name: Upload release artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
token: ${{ secrets.FIREBASE_TOKEN }}
groups: testers
file: app/build/outputs/apk/release/app-release.apk
- name: Build debug distribution
env:
VERSION_CODE: ${{ github.run_number }}
run: ./gradlew assembleDebug
- name: Upload debug artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1
with:
appId: ${{ secrets.FIREBASE_APP_ID_DEBUG }}
token: ${{ secrets.FIREBASE_TOKEN }}
groups: testers
file: app/build/outputs/apk/debug/app-debug.apk
- name: Notify Teams channel
uses: skitionek/notify-microsoft-teams@master
if: always()
with:
webhook_url: ${{ secrets.CHANNEL_WEBHOOK }}
job: ${{ toJson(job) }}
steps: ${{ toJson(steps) }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment