Repository navigation
Firebase App Distribution #26
This file contains hidden or 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: Firebase App Distribution | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: Distribution tag to build from | |
| required: true | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ inputs.tag_name || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| distribute: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: Prezel | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ inputs.tag_name }} | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'gradle' | |
| cache-dependency-path: | | |
| Prezel/*.gradle* | |
| Prezel/**/gradle-wrapper.properties | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Create local.properties | |
| run: echo "${{ secrets.LOCAL_PROPERTIES_CONTENTS }}" > ./local.properties | |
| - name: Create google-services.json | |
| run: | | |
| cat <<'EOF' > ./app/google-services.json | |
| ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| EOF | |
| - name: Create Android release keystore | |
| run: | | |
| echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > ./prezel.jks | |
| - name: Prepare version metadata | |
| run: | | |
| DISTRIBUTION_TAG="${{ inputs.tag_name }}" | |
| echo "DISTRIBUTION_TAG=$DISTRIBUTION_TAG" >> "$GITHUB_ENV" | |
| echo "ANDROID_VERSION_CODE=${GITHUB_RUN_NUMBER}" >> "$GITHUB_ENV" | |
| echo "ANDROID_VERSION_NAME=${DISTRIBUTION_TAG#v}" >> "$GITHUB_ENV" | |
| echo "APP_APPLICATION_ID=com.team.prezel.dev" >> "$GITHUB_ENV" | |
| echo "APP_NAME=Prezel (Internal)" >> "$GITHUB_ENV" | |
| - name: Build Release APK | |
| run: ./gradlew assembleRelease --build-cache --parallel | |
| - name: Upload to Firebase App Distribution | |
| uses: wzieba/Firebase-Distribution-Github-Action@v1 | |
| with: | |
| appId: ${{ vars.FIREBASE_APP_ID }} | |
| serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
| groups: ${{ vars.FIREBASE_APP_DISTRIBUTION_GROUPS }} | |
| releaseNotes: | | |
| Tag: ${{ env.DISTRIBUTION_TAG }} | |
| Commit: ${{ github.sha }} | |
| Actor: ${{ github.actor }} | |
| Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| file: ./Prezel/app/build/outputs/apk/release/app-release.apk | |
| - name: Send Discord Notification | |
| if: always() | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISTRIBUTION_DISCORD_HOOK_URL }} | |
| STATUS_TITLE: ${{ job.status == 'success' && '✅ Firebase Release 배포 성공' || '❌ Firebase Release 배포 실패' }} | |
| STATUS_COLOR: ${{ job.status == 'success' && '3066993' || '15158332' }} | |
| BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| EVENT_TIMESTAMP: ${{ github.event.head_commit.timestamp || github.event.repository.pushed_at }} | |
| run: | | |
| if [ -z "$DISCORD_WEBHOOK" ]; then | |
| echo "DISTRIBUTION_DISCORD_HOOK_URL is not set. Skipping Discord notification." | |
| exit 0 | |
| fi | |
| curl -H "Content-Type: application/json" -X POST -d "$(cat <<EOF | |
| { | |
| "embeds": [ | |
| { | |
| "title": "$STATUS_TITLE", | |
| "description": "Firebase Distribution Release APK 배포가 완료되었습니다.", | |
| "color": $STATUS_COLOR, | |
| "fields": [ | |
| { | |
| "name": "🏷 Tag", | |
| "value": "${{ env.DISTRIBUTION_TAG }}" | |
| }, | |
| { | |
| "name": "📦 Version", | |
| "value": "${{ env.ANDROID_VERSION_NAME }} ・ #${{ github.run_number }} <${{ env.ANDROID_VERSION_CODE }}>" | |
| }, | |
| { | |
| "name": "👥 Tester Group", | |
| "value": "${{ vars.FIREBASE_APP_DISTRIBUTION_GROUPS }}" | |
| }, | |
| { | |
| "name": "🔗 Action Log", | |
| "value": "[바로가기]($BUILD_URL)" | |
| } | |
| ], | |
| "footer": { | |
| "text": "Prezel Firebase Distribution" | |
| }, | |
| "timestamp": "$EVENT_TIMESTAMP" | |
| } | |
| ] | |
| } | |
| EOF | |
| )" "$DISCORD_WEBHOOK" |