diff --git a/.github/workflows/released-app-distribution.yml b/.github/workflows/released-app-distribution.yml new file mode 100644 index 00000000..71aad31e --- /dev/null +++ b/.github/workflows/released-app-distribution.yml @@ -0,0 +1,111 @@ +name: Released-App-Distribution +on: + push: + branches: + - 'release' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: zulu + cache: gradle + + - name: add google-services.json + run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json + + - name: add local.properties + run: | + echo api_key=\"${{ secrets.API_KEY }}\" >> ./local.properties + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Build release APK + run: ./gradlew assembleRelease + + - name: Setup build tool version variable + shell: bash + run: | + BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV + echo Last build tool version is: $BUILD_TOOL_VERSION + + - name: Sign APK + id: sign_app + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.KEY_BASE_64_RELEASE }} + alias: ${{ secrets.KEY_ALIAS }} + keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} + + - name: Authenticate to Firebase + uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} + + - name: Setup Firebase CLI + run: curl -sL https://firebase.tools | bash + + - name: upload artifact to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1.7.0 + with: + appId: ${{secrets.FIREBASE_APP_ID}} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: WAPP_QA + file: ${{steps.sign_app.outputs.signedReleaseFile}} + + - name: Send Success Message + if: ${{ success() }} + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + DISCORD_USERNAME: WAPP_BOT + DISCORD_AVATAR: https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true + DISCORD_EMBEDS: | + [ + { + "author": { + "name": "WAPP Release", + "url": "https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true", + "icon_url": "https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true" + }, + "title": "릴리즈 성공, 자 두 과 자 ~ 🔥🔥", + "color": 10478271, + "description": "메일에 새로운 릴리즈 앱 배송완료했어요!" + } + ] + + - name: Send Failure Message + if: ${{ failure() }} + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + DISCORD_USERNAME: WAPP_BOT + DISCORD_AVATAR: https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true + DISCORD_EMBEDS: | + [ + { + "author": { + "name": "WAPP Release", + "url": "https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true", + "icon_url": "https://github.com/pknu-wap/WAPP/blob/main/image/icon.png?raw=true" + }, + "title": "릴리즈 실패, 누가 이렇게 하래. 😭😭", + "color": 13458524, + "description": "다시 릴리즈 해오세요. 삐빅" + } + ] diff --git a/build-logic/convention/src/main/java/com/wap/wapp/plugin/AndroidApplicationPlugin.kt b/build-logic/convention/src/main/java/com/wap/wapp/plugin/AndroidApplicationPlugin.kt index bb28f0f9..334271fe 100644 --- a/build-logic/convention/src/main/java/com/wap/wapp/plugin/AndroidApplicationPlugin.kt +++ b/build-logic/convention/src/main/java/com/wap/wapp/plugin/AndroidApplicationPlugin.kt @@ -1,5 +1,6 @@ package com.wap.wapp.plugin +import com.wap.wapp.plugin.configure.configureApplicationVersion import com.wap.wapp.plugin.configure.configureKotlinAndroid import org.gradle.api.Plugin import org.gradle.api.Project @@ -12,6 +13,7 @@ class AndroidApplicationPlugin : Plugin { apply("org.jetbrains.kotlin.android") } configureKotlinAndroid() + configureApplicationVersion() } } } diff --git a/build-logic/convention/src/main/java/com/wap/wapp/plugin/configure/AndroidVersion.kt b/build-logic/convention/src/main/java/com/wap/wapp/plugin/configure/AndroidVersion.kt new file mode 100644 index 00000000..5f83d1cf --- /dev/null +++ b/build-logic/convention/src/main/java/com/wap/wapp/plugin/configure/AndroidVersion.kt @@ -0,0 +1,17 @@ +package com.wap.wapp.plugin.configure + +import com.android.build.gradle.BaseExtension +import org.gradle.api.Project +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.kotlin.dsl.getByType + +internal fun Project.configureApplicationVersion() { + val libs = extensions.getByType().named("libs") + + extensions.getByType().apply { + defaultConfig { + versionCode = libs.findVersion("versionCode").get().requiredVersion.toInt() + versionName = libs.findVersion("versionName").get().requiredVersion + } + } +} diff --git a/gradle.properties b/gradle.properties index cd964a86..0e41e681 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,3 +28,6 @@ org.gradle.configureondemand=true org.gradle.configuration-cache=true org.gradle.parallel=true kotlin.incremental=true + +# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom +kotlin.incremental.useClasspathSnapshot=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e9c07ca..b3ff0eac 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ compileSdk = "34" minSdk = "26" targetSdk = "34" -versionName = "1.0" +versionName = "1.0.0" versionCode = "1" gradleplugin = "8.1.2" diff --git a/release-note.txt b/release-note.txt deleted file mode 100644 index 73a479a0..00000000 --- a/release-note.txt +++ /dev/null @@ -1,21 +0,0 @@ -WAPP Release 1.0.0v - -공지사항 -WAP 정규 활동 및 행사를 달력과 목록을 통해 확인할 수 있어요. - -출석 -행사마다 출석을 체크할 수 있어요. -히스토리를 통해 출결상황을 체크할 수 있어요. - -설문 -행사마다 설문 및 피드백을 작성할 수 있어요 -설문과 피드백을 통해, 더 좋은 행사로 발전할 수 있어요. - -운영진 -회원들의 설문을 확인할 수 있어요. -공지사항 및 설문을 등록할 수 있어요. -출석을 시작할 수 있어요 - -그 외 -프로필 -프로필 더 보기