-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Android APK Build and Slack Upload | ||
|
||
on: | ||
workflow_dispatch: # λ²νΌμ λλ₯Ό μ μ€νλλλ‘ μ€μ | ||
inputs: | ||
environment: | ||
description: 'Select environment' | ||
required: true | ||
default: 'qa' | ||
type: choice | ||
options: | ||
- qa | ||
- production | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Create Local Properties | ||
run: touch local.properties | ||
|
||
- name: Access Local Properties | ||
env: | ||
DEV_BASE_URL: ${{ secrets.DEV_BASE_URL }} | ||
PROD_BASE_URL: ${{ secrets.PROD_BASE_URL }} | ||
KAKAO_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }} | ||
run: | | ||
echo DEV_BASE_URL=\"$DEV_BASE_URL\" >> local.properties | ||
echo PROD_BASE_URL=\"$PROD_BASE_URL\" >> local.properties | ||
echo KAKAO_NATIVE_APP_KEY=$KAKAO_APP_KEY >> local.properties | ||
|
||
- name: Generate google-services.json | ||
run: | | ||
echo "$GOOGLE_SERVICE" > app/google-services.json.b64 | ||
base64 -d -i app/google-services.json.b64 > app/google-services.json | ||
env: | ||
GOOGLE_SERVICE: ${{ secrets.GOOGLE_SERVICE }} | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build Debug APK | ||
run: ./gradlew assembleDebug --stacktrace | ||
|
||
- name: Upload APK | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app | ||
path: app/build/outputs/apk/debug/app-debug.apk | ||
|
||
- name: Slack - Send Msg | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: workflow,commit,repo,author,job,ref,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
|
||
- name: Slack - Upload APK | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: MeilCli/slack-upload-file@v4 | ||
with: | ||
slack_token: ${{ secrets.SLACK_TOKEN }} | ||
channel_id: ${{ secrets.SLACK_CHANNEL }} | ||
initial_comment: 'APK λΉλκ° μλ£λμμ΅λλ€.' | ||
file_type: 'apk' | ||
file_name: 'app-debug.apk' | ||
file_path: './app/build/outputs/apk/debug/app-debug.apk' |