Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] CD Pipeline #227

Merged
merged 20 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Android Release CD

on:
release:
types: [published]

jobs:
release:
env:
TITLE: ${{ github.event.release.name }}
KEYSTORE: ${{ secrets.DODAM_KEYSTORE }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Generate Keystore File
run: |
echo '${{ env.KEYSTORE }}' | base64 --d > ./dodam.jks
ls

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run Student spotless
if: startsWith(env.TITLE, 'Student')
run: ./gradlew dodam-student:spotlessCheck

- name: Run Teacher spotless
if: startsWith(env.TITLE, 'Teacher')
run: ./gradlew dodam-teacher-android:spotlessCheck

- name: Assemble Student Release Bundle
if: startsWith(env.TITLE, 'Student')
run: ./gradlew dodam-student:bundleRelease

- name: Assemble Teacher Release Bundle
if: startsWith(env.TITLE, 'Teacher')
run: ./gradlew dodam-teacher-android:bundleRelease

- name: Sign Student Release
if: startsWith(env.TITLE, 'Student')
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: ./dodam-student/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.DODAM_KEYSTORE }}
keyStorePassword: ${{ secrets.DODAM_KEYSTORE_PASSWORD }}
alias: ${{ secrets.DODAM_KEYSTORE_ALIAS }}
keyPassword: ${{ secrets.DODAM_KEYSTORE_PASSWORD }}

- name: Sign Teacher Release
if: startsWith(env.TITLE, 'Teacher')
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: ./dodam-teacher-android/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.DODAM_KEYSTORE }}
keyStorePassword: ${{ secrets.DODAM_KEYSTORE_PASSWORD }}
alias: ${{ secrets.DODAM_KEYSTORE_ALIAS }}
keyPassword: ${{ secrets.DODAM_KEYSTORE_PASSWORD }}

- name: Setup Authorization With Google Play Store
run: echo '${{ secrets.DODAM_GOOGLE_PLAY_API_AUTH }}' > service_account.json

- name: Prepare Patch Notes
run: |
mkdir -p whatsNewDirectory
echo "${{ github.event.release.body }}" > whatsNewDirectory/whatsnew-ko-KR

- name: Student Dodam Deploy to Production Channel
if: startsWith(env.TITLE, 'Student')
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.b1nd.dodam.student
releaseFiles: ./dodam-student/build/outputs/bundle/release/dodam-student-release.aab
track: production
status: completed
inAppUpdatePriority: 2
whatsNewDirectory: whatsNewDirectory/

- name: Teacher Dodam Deploy to Production Channel
if: startsWith(env.TITLE, 'Teacher')
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.b1nd.dodam.teacher
releaseFiles: ./dodam-teacher-android/build/outputs/bundle/release/dodam-teacher-android-release.aab
track: production
status: completed
inAppUpdatePriority: 2
whatsNewDirectory: whatsNewDirectory/



2 changes: 1 addition & 1 deletion dodam-teacher-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {
applicationId = "com.b1nd.dodam.teacher"
minSdk = 28
targetSdk = 34
versionCode = 1
versionCode = 2
versionName = "3.0.0"

}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compileSdk = "34"
minSdk = "28"
targetSdk = "34"
appVersion = "3.3.0"
versionCode = "6"
versionCode = "8"

# kotlin
kotlin = "2.0.0"
Expand Down
Loading