Merge branch 'master' into develop #43
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: CD Test Publish | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
name: Build, Upload | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Setup: Clone' | |
uses: actions/checkout@v1 | |
- name: 'Setup: JDK 11' | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
# -------------------------------------------------- # | |
# Build Staging # | |
# -------------------------------------------------- # | |
- name: 'Build: Assemble Staging APK' | |
run: ./gradlew assembleStagingDebug | |
- name: 'Upload a Build APK' | |
uses: actions/[email protected] | |
with: | |
name: guardian-staging | |
path: app/build/outputs/apk/staging/debug/app-staging-debug.apk | |
# -------------------------------------------------- # | |
# Build Production # | |
# -------------------------------------------------- # | |
- name: 'Build: Assemble Production APK' | |
run: ./gradlew assembleProductionRelease | |
- uses: r0adkll/sign-android-release@v1 | |
name: 'Sign an APK' | |
id: sign_app | |
with: | |
releaseDirectory: app/build/outputs/apk/production/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.KEY_STORE_ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "30.0.2" | |
- name: 'Upload a Signed APK' | |
uses: actions/[email protected] | |
with: | |
name: guardian-production | |
path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
# -------------------------------------------------- # | |
# Distribute to Testers # | |
# -------------------------------------------------- # | |
- name: Upload Prod to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID}} | |
token: ${{secrets.FIREBASE_TOKEN}} | |
groups: qa-team | |
releaseNotesFile: releaseDetail/whatsnew-en-US | |
file: ${{steps.sign_app.outputs.signedReleaseFile}} | |
- name: Upload Staging to Firebase App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID_STAGING}} | |
token: ${{secrets.FIREBASE_TOKEN}} | |
groups: qa-team | |
releaseNotesFile: releaseDetail/whatsnew-en-US | |
file: app/build/outputs/apk/staging/debug/app-staging-debug.apk | |
# -------------------------------------------------- # | |
# Notify Slack # | |
# -------------------------------------------------- # | |
- name: 'Notify: Get Slack User' | |
uses: kanga333/variable-mapper@92703696e9a3f370901c3d53ae3836569b1055e5 | |
if: always() | |
with: | |
key: '${{ github.event.sender.login }}' | |
map: | | |
{ | |
"Tooseriuz": { "SLACK_MENTION_USERS": "UC905TCTV" }, | |
"RatreeOchn": { "SLACK_MENTION_USERS": "UK4PVHM9C" } | |
} | |
- name: 'Notify: Slack Failed' | |
uses: ravsamhq/notify-slack-action@v1 | |
if: always() | |
with: | |
notify_when: 'failure,warning' | |
status: ${{ job.status }} | |
notification_title: '❌ CD: Publish Guardian Staging/Production' | |
message_format: '*FAILED:* More detail in <{run_url}|${{ github.run_id }}>' | |
footer: '<{run_url}|{status_message}> at <{commit_url}|{commit_sha}> (triggered by ${{ env.SENDER }})' | |
mention_users_when: 'failure,warnings' | |
mention_users: ${{ env.SLACK_MENTION_USERS }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_COREDT_WEBHOOK }} | |
SENDER: ${{ github.event.sender.login }} | |
- name: 'Notify: Slack Success' | |
uses: ravsamhq/notify-slack-action@v1 | |
if: always() | |
with: | |
notify_when: 'success' | |
status: ${{ job.status }} | |
notification_title: '✅ CD: Publish Guardian Staging/Production' | |
message_format: '*SUCCESS:* Download Staging/Prodution APKs in <{run_url}|here>' | |
footer: '<{run_url}|{status_message}> at <{commit_url}|{commit_sha}> (triggered by ${{ env.SENDER }})' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_COREDT_WEBHOOK }} | |
SENDER: ${{ github.event.sender.login }} |