From 1d51509ace733114f1084d3b852bcf4688edc51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=91=EC=A3=BC=ED=98=84?= Date: Sun, 28 Jan 2024 23:06:13 +0900 Subject: [PATCH] =?UTF-8?q?manual=20deploy=20=EA=B0=9C=EC=84=A0=20(firebas?= =?UTF-8?q?e=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=84=A0=ED=83=9D)=20(#246)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 송동엽 --- .github/workflows/manual_deploy.yml | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual_deploy.yml b/.github/workflows/manual_deploy.yml index 0b963515a..bd34b19a3 100644 --- a/.github/workflows/manual_deploy.yml +++ b/.github/workflows/manual_deploy.yml @@ -10,9 +10,15 @@ on: options: - live - staging + firebase: + type: boolean + description: Upload artifact to Firebase slack: type: boolean - description: Send message to slack + description: Send artifact to slack + slack_message: + type: string + description: Message to send with artifact jobs: deploy: @@ -89,10 +95,10 @@ jobs: SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} - name: Upload artifact to Firebase App Distribution (Live) - if: startsWith(github.event.inputs.variant, 'live') + if: ${{ github.event.inputs.firebase == 'true' && startsWith(github.event.inputs.variant, 'Live') }} run: ./gradlew appDistributionUploadLiveRelease - name: Upload artifact to Firebase App Distribution (Staging) - if: startsWith(github.event.inputs.variant, 'staging') + if: ${{ github.event.inputs.firebase == 'true' && startsWith(github.event.inputs.variant, 'staging') }} run: ./gradlew appDistributionUploadStagingRelease - name: Set Message if: ${{ github.event.inputs.slack == 'true' }} @@ -100,7 +106,7 @@ jobs: PROPERTY=$(head -n 1 version.properties) VERSION="${PROPERTY/snuttVersionName=}" TITLE="SNUTT Android 빌드 알림" - MESSAGE="${VERSION} 빌드 완료" + MESSAGE=${{ github.event.inputs.slack_message }} echo "TITLE=$TITLE" >> $GITHUB_ENV echo "MESSAGE=$MESSAGE" >> $GITHUB_ENV - name: Slack Notification @@ -110,4 +116,24 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_TITLE: ${{ env.TITLE }} SLACK_MESSAGE: ${{ env.MESSAGE }} - SLACK_USERNAME: BuildNoti \ No newline at end of file + SLACK_USERNAME: BuildNoti + - name: Slack Upload APK (Live) + if: ${{ github.event.inputs.slack == 'true' && startsWith(github.event.inputs.variant, 'live') }} + uses: MeilCli/slack-upload-file@v3 + with: + slack_token: ${{ secrets.SLACK_READ_WRITE_TOKEN }} + channel_id: ${{ secrets.SLACK_DEPLOY_CHANNEL_ID }} + file_path: './app/build/outputs/apk/live/release/app-live-release.apk' + file_name: 'app-live-release.apk' + file_type: 'apk' + initial_comment: 'live-release APK' + - name: Slack Upload APK (Staging) + if: ${{ github.event.inputs.slack == 'true' && startsWith(github.event.inputs.variant, 'staging') }} + uses: MeilCli/slack-upload-file@v3 + with: + slack_token: ${{ secrets.SLACK_READ_WRITE_TOKEN }} + channel_id: ${{ secrets.SLACK_DEPLOY_CHANNEL_ID }} + file_path: './app/build/outputs/apk/staging/release/app-staging-release.apk' + file_name: 'app-staging-release.apk' + file_type: 'apk' + initial_comment: 'staging-release APK' \ No newline at end of file