Repository navigation
90 lines (76 loc) · 3.14 KB
/
Copy pathdeploy.yml
File metadata and controls
90 lines (76 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CD / Deploy to Internal Track
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Version Name
run: |
VERSION_NAME=$(grep 'versionName = ' app/build.gradle.kts | grep -oP '"\K[^"]+')
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Decode Keystore
run: |
mkdir -p keystore
echo "${{ secrets.RELEASE_KEYSTORE_BASE64 }}" | base64 --decode > keystore/release.jks
- name: Create local.properties
run: |
echo "KAKAO_NATIVE_APP_KEY=${{ secrets.KAKAO_NATIVE_APP_KEY }}" >> local.properties
echo "GOOGLE_WEB_CLIENT_ID=${{ secrets.GOOGLE_WEB_CLIENT_ID }}" >> local.properties
echo "MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}" >> local.properties
echo "RELEASE_STORE_FILE=../keystore/release.jks" >> local.properties
echo "RELEASE_STORE_PASSWORD=${{ secrets.RELEASE_STORE_PASSWORD }}" >> local.properties
echo "RELEASE_KEY_ALIAS=${{ secrets.RELEASE_KEY_ALIAS }}" >> local.properties
echo "RELEASE_KEY_PASSWORD=${{ secrets.RELEASE_KEY_PASSWORD }}" >> local.properties
- name: Build Release AAB
run: ./gradlew bundleRelease
- name: Upload to Play Store Internal Track
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
packageName: com.arttrip.app
releaseFiles: app/build/outputs/bundle/release/*.aab
track: internal
- name: Create and Push Git Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git tag "v${VERSION_NAME}"
git push origin "v${VERSION_NAME}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ env.VERSION_NAME }}"
generate_release_notes: true
- name: Discord 성공 알림
if: success()
run: |
curl -H "Content-Type: application/json" \
-d '{
"content": "✅ **v${{ env.VERSION_NAME }}** 내부 테스트 트랙 배포 성공"
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Discord 실패 알림
if: failure()
run: |
curl -H "Content-Type: application/json" \
-d '{
"content": "❌ **v${{ env.VERSION_NAME }}** 내부 테스트 트랙 배포 실패\n🔗 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}