From 26f5e02afa70af8d72779d455eb512817e62e177 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 9 Apr 2024 17:00:14 -0700 Subject: [PATCH] notify slack on production builds (#3460) --- .github/workflows/build-submit-android.yml | 39 ++++++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-submit-android.yml b/.github/workflows/build-submit-android.yml index dec4e0e7e8..9d7790da06 100644 --- a/.github/workflows/build-submit-android.yml +++ b/.github/workflows/build-submit-android.yml @@ -62,38 +62,55 @@ jobs: - name: 🏗️ EAS Build run: yarn use-build-number-with-bump eas build -p android --profile ${{ inputs.profile || 'testflight-android' }} --local --output build.aab --non-interactive - - name: 🚀 Deploy - if: ${{ inputs.profile == 'production' }} - run: eas submit -p android --non-interactive --path build.aab - - - name: ✍️ Rename bundle + - name: ✍️ Rename Testflight bundle if: ${{ inputs.profile != 'production' }} run: mv build.aab build.apk - name: ⏰ Get a timestamp id: timestamp - if: ${{ inputs.profile != 'production' }} uses: nanzm/get-time-action@master with: format: 'MM-DD-HH-mm-ss' - - name: 🚀 Upload Artifact - id: upload-artifact + - name: 🚀 Upload Production Artifact + id: upload-artifact-production + if: ${{ inputs.profile == 'production' }} + uses: actions/upload-artifact@v4 + with: + retention-days: 30 + compression-level: 6 + name: build-${{ steps.timestamp.outputs.time }}.aab + path: build.apk + + - name: 🚀 Upload Testflight Artifact + id: upload-artifact-testflight if: ${{ inputs.profile != 'production' }} uses: actions/upload-artifact@v4 with: retention-days: 30 - compression-level: 0 + compression-level: 6 name: build-${{ steps.timestamp.outputs.time }}.apk path: build.apk - - name: 🔔 Notify Slack + - name: 🔔 Notify Slack of Production Build + if: ${{ inputs.profile == 'production' }} + uses: slackapi/slack-github-action@v1.25.0 + with: + payload: | + { + "text": "Android build is ready for submission. This is a production build! Download the artifact here: ${{ steps.upload-artifact-production.outputs.artifact-url }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + - name: 🔔 Notify Slack of Testflight Build if: ${{ inputs.profile != 'production' }} uses: slackapi/slack-github-action@v1.25.0 with: payload: | { - "text": "Android build is ready for testing. Download the artifact here: ${{ steps.upload-artifact.outputs.artifact-url }}" + "text": "Android build is ready for testing. Download the artifact here: ${{ steps.upload-artifact-testflight.outputs.artifact-url }}" } env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLIENT_ALERT_WEBHOOK }}