Skip to content

Commit

Permalink
chore: build CI 작업을 위한 manifest 파일 수정 (#65)
Browse files Browse the repository at this point in the history
* chore: 알람 권한 추가

* chore: local properties 속성 추가

* chore: local properties null 체크 로직 추가

* chore: buildConfigField null 체크

* style: lint 적용

* chore: secret 값 설정

* fix: secret 값 오류 수정

* fix: 문법 오류 수정

* chore: 경로 수정

* chore: 문법 수정

* style: lint 적용
  • Loading branch information
chaehyuns authored Jul 24, 2024
1 parent f0e5c19 commit b61934c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 58 deletions.
128 changes: 73 additions & 55 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,79 @@ jobs:
ktlint_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v4
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: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Ktlint check
run: ./gradlew ktlintCheck

- uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create local.properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
run: |
echo "sdk.dir=/Users/chaehyun/Library/Android/sdk" > ./local.properties
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

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

- name: Ktlint check
run: ./gradlew ktlintCheck

build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v4
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: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Gradle Clean check
run: ./gradlew clean

- name: Build with Gradle
run: ./gradlew build

- name: Run Unit Test
run: ./gradlew test
- uses: actions/checkout@v4

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create local.properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
TOKEN: ${{ secrets.TOKEN }}
run: |
echo "sdk.dir=/Users/chaehyun/Library/Android/sdk" > ./local.properties
echo "base_url=$BASE_URL" >> ./local.properties
echo "token=$TOKEN" >> ./local.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

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

- name: Gradle Clean check
run: ./gradlew clean

- name: Build with Gradle
run: ./gradlew build

- name: Run Unit Test
run: ./gradlew test
14 changes: 11 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ android {

val properties =
Properties().apply {
load(FileInputStream(rootProject.file("local.properties")))
try {
load(FileInputStream(rootProject.file("local.properties")))
} catch (e: Exception) {
e.printStackTrace()
}
}

defaultConfig {
Expand All @@ -31,8 +35,11 @@ android {
useSupportLibrary = true
}

buildConfigField("String", "BASE_URL", properties["base_url"] as String)
buildConfigField("String", "TOKEN", properties["token"] as String)
val baseUrl = properties.getProperty("base_url")
val token = properties.getProperty("token")

buildConfigField("String", "BASE_URL", "\"$baseUrl\"")
buildConfigField("String", "TOKEN", "\"$token\"")
}

buildTypes {
Expand Down Expand Up @@ -90,6 +97,7 @@ dependencies {

implementation("androidx.room:room-runtime:2.6.1")
kapt("androidx.room:room-compiler:2.6.1")
implementation("androidx.room:room-ktx:2.6.1")
implementation("com.google.code.gson:gson:2.8.8")

implementation("com.github.bumptech.glide:glide:4.12.0")
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:name=".ChongdaeApp"
Expand Down

0 comments on commit b61934c

Please sign in to comment.