-
Notifications
You must be signed in to change notification settings - Fork 0
[add] Github Actions를 이용한 CD 도입 #313
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
Open
sxunea
wants to merge
11
commits into
develop
Choose a base branch
from
feature/add-ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b46945b
[add] #290 data null일경우 블록 탈출하고 리턴하도록 처리 추
sxunea 0cf2db4
Revert "[add] #290 data null일경우 블록 탈출하고 리턴하도록 처리 추"
sxunea 7265265
[add] #312 Github Actions 를 활용한 CD 도입
sxunea 2a5a3c2
[mod] #312 google-services json 파일 생성
sxunea f89ebc7
[mod] #312 jdk 주체 통일
sxunea 9b02be4
[fix] #312 문자열을 따옴표 안에 있는 것으로 인식하게 하여 구문 오류 방지
sxunea 48c55dc
[add] #312 keystore jks 존재하는지 확인
sxunea 56fc265
[add] #312 keystore jks 내용 확인
sxunea e855fe1
[add] #312 워크플로우 권한 설정
sxunea d5d0218
[chore] #312 버전코드, 버전네임 업
sxunea a39183d
Merge remote-tracking branch 'origin/develop' into feature/add-ci
sxunea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,102 @@ | ||
| # JVM 옵션을 설정, 최대 힙 메모리를 4GB로 | ||
| env: | ||
| GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false" | ||
| GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | ||
|
|
||
| # main, develop 브랜치에 PR을 올릴 시 트리거 | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| - main | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 올린 코드가 프로덕션 앱 배포까지 자동화 하는 건지, 테스트 앱 배포만 자동화 하는 건지 궁금합니다! 저는 테스트 앱 배포 자동화라고 이해했는데, 그렇다면 release 브랜치에 PR이 올라올 때 CD가 트리거 되어야 할 거 같아요! (main 브랜치는 프로덕션 버전 앱 배포 준비할 때 사용하고 있으니까) |
||
|
|
||
| # 전체 워크플로우에 대한 권한 설정 | ||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| cd-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: 17 | ||
|
|
||
| - name: Generate winey.keystore.jks | ||
| run: echo '${{ secrets.WINEY_KEYSTORE }}' | base64 -d > ./app/winey.jks | ||
|
|
||
| - name: Check if winey.jks exists | ||
| run: | | ||
| if [ -f "./app/winey.jks" ]; then | ||
| echo "winey.jks file exists in the app directory." | ||
| else | ||
| echo "Error: winey.jks file is missing in the app directory." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: List keys in winey.jks | ||
| run: | | ||
| keytool -list -v -keystore ./app/winey.jks -storepass "${{ secrets.STORE_PASSWORD }}" | ||
|
|
||
| - name: Generate local.properties | ||
| env: | ||
| AUTH_BASE_URL: ${{ secrets.AUTH_BASE_URL }} | ||
| KAKAO_NATIVE_KEY: ${{ secrets.KAKAO_NATIVE_KEY }} | ||
| AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} | ||
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
| STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} | ||
| run: | | ||
| echo auth.base.url=\"$AUTH_BASE_URL\" >> ./local.properties | ||
| echo kakao.native.key=\"$KAKAO_NATIVE_KEY\" >> ./local.properties | ||
| echo amplitude.api.key=\"$AMPLITUDE_API_KEY\" >> ./local.properties | ||
| echo kakaoNativeKey=$KAKAO_NATIVE_KEY >> ./local.properties | ||
| echo keyAlias=$KEY_ALIAS >> ./local.properties | ||
| echo keyPassword=$KEY_PASSWORD >> ./local.properties | ||
| echo storePassword=$STORE_PASSWORD >> ./local.properties | ||
|
|
||
| - name: Create Google Services JSON File | ||
| env: | ||
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | ||
| run: echo $GOOGLE_SERVICES_JSON > ./app/google-services.json | ||
|
|
||
|
|
||
| # PR 제목에서 release v*.*.* 형식의 버전을 추출 | ||
| - name: Extract Version Name | ||
| run: echo "##[set-output name=version;]v$(echo '${{ github.event.pull_request.title }}' | grep -oP 'release v\K[0-9]+\.[0-9]+\.[0-9]+')" | ||
| id: extract_version | ||
|
|
||
| - name: Build Release APK | ||
| run: | | ||
| ./gradlew :app:assembleRelease | ||
|
|
||
| # GitHub Actions Artifacts에 릴리즈 apk 추출 | ||
| - name: Upload Release Build to Artifacts | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: release-artifacts | ||
| path: app/build/outputs/apk/release/ | ||
| if-no-files-found: error | ||
|
|
||
| - name: Create Github Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: ${{ steps.extract_version.outputs.version }} | ||
| release_name: ${{ steps.extract_version.outputs.version }} | ||
| generate_release_notes: true | ||
| files: | | ||
| app/build/outputs/apk/release/app-release.apk | ||
|
|
||
| - name: Upload artifact to Firebase App Distribution | ||
| uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
| with: | ||
| appId: ${{secrets.FIREBASE_APP_ID}} | ||
| serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | ||
| groups: testers | ||
| file: app/build/outputs/apk/release/app-release.apk | ||
File renamed without changes.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4GB로 설정한 이유가 있는지 궁금합니다!