-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Github Action CD 환경 구축 #110
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
066dc58
[BOOK-223] chore: AndroidRetrofitConventionPlugin 내 필요없는 코드 제거
easyhooon bf7e0aa
[BOOK-223] chore: Firebase App Distribution을 통한 CD 환경 구축
easyhooon f42a6bb
[BOOK-223] chore: softprops/action-gh-release version update
easyhooon 2b3d194
[BOOK-223] chore: local.properties, keystore.properties base64 인코딩 적용
easyhooon 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,107 @@ | ||
| name: Android CD | ||
|
|
||
| env: | ||
| GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false" | ||
| GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| cd-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # 최근 태그를 확인하기 위해 필요 | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'corretto' | ||
| java-version: 17 | ||
|
|
||
| - name: Generate reed.jks | ||
| run: echo '${{ secrets.REED_JAVA_KEYSTORE }}' | base64 -d > ./reed.jks | ||
|
|
||
| - name: Generate local.properties | ||
| run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties | ||
|
|
||
| - name: Generate keystore.properties | ||
| run: echo '${{ secrets.KEYSTORE_PROPERTIES }}' | base64 -d > ./keystore.properties | ||
|
|
||
| - name: Generate google-services.json | ||
| run: echo '${{ secrets.GOOGLE_SERVICES }}' | base64 -d > ./app/google-services.json | ||
|
|
||
| - name: Extract Version Name from ApplicationConstants.kt | ||
| run: | | ||
| set -euo pipefail | ||
| VERSION=$(grep "VERSION_NAME" build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt | sed -E 's/.*VERSION_NAME\s*=\s*"([^"]+)".*/\1/') | ||
| if [[ -z "$VERSION" ]]; then | ||
| echo "Error: ApplicationConstants.kt에서 VERSION_NAME 값을 추출하지 못했습니다." >&2 | ||
| exit 1 | ||
| fi | ||
| echo "version=v${VERSION}" >> "$GITHUB_OUTPUT" | ||
| echo "Version extracted from ApplicationConstants.kt: v${VERSION}" | ||
| id: extract_version | ||
|
|
||
| - name: Generate Firebase Release Note | ||
| id: firebase_release_note | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| # PR_TITLE은 env에서 안전하게 전달됨 | ||
| # 가장 최근 태그 찾기 (현재 버전 이전의 태그) | ||
| LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | ||
|
|
||
| # 릴리스 노트 내용 생성 | ||
| NOTES="## 🚀 변경사항: ${PR_TITLE}\n\n" | ||
|
|
||
| if [ -n "$LATEST_TAG" ]; then | ||
| NOTES="${NOTES}### 이전 버전($LATEST_TAG)부터의 변경사항:\n" | ||
| # 최근 태그부터 현재까지의 커밋만 가져옴 | ||
| COMMITS=$(git log --pretty=format:"- %h %s (%an)" ${LATEST_TAG}..HEAD --no-merges) | ||
| NOTES="${NOTES}${COMMITS}" | ||
| else | ||
| NOTES="${NOTES}### 커밋 내역:\n" | ||
| # 태그가 없는 경우 최근 10개 커밋만 표시 | ||
| COMMITS=$(git log --pretty=format:"- %h %s (%an)" --no-merges -n 10) | ||
| NOTES="${NOTES}${COMMITS}\n\n(이전 릴리스 태그가 없어 최근 10개 커밋만 표시)" | ||
| fi | ||
|
|
||
| # 환경 변수로 저장 | ||
| echo "notes<<EOF" >> $GITHUB_OUTPUT | ||
| echo -e "$NOTES" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build Release AAB | ||
| run: | | ||
| ./gradlew :app:bundleRelease | ||
|
|
||
| - name: Upload Release Build to Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-artifacts | ||
| path: app/build/outputs/bundle/release/ | ||
| if-no-files-found: error | ||
|
|
||
| - name: Create Github Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ steps.extract_version.outputs.version }} | ||
| release_name: ${{ steps.extract_version.outputs.version }} | ||
| generate_release_notes: true | ||
|
|
||
| - name: Upload artifact to Firebase App Distribution | ||
| uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
| with: | ||
| appId: ${{secrets.FIREBASE_RELEASE_APP_ID}} | ||
| serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | ||
| groups: testers | ||
| file: app/build/outputs/bundle/release/app-release.aab | ||
| releaseNotes: ${{ steps.firebase_release_note.outputs.notes }} | ||
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
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
Oops, something went wrong.
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.
release_name입력 파라미터는 v2에서 지원되지 않습니다softprops/action-gh-release@v2에서는release_name대신name입력을 사용합니다. 그대로 두면 워크플로가 “input not defined” 오류로 실패합니다.📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
97-97: input "release_name" is not defined in action "softprops/action-gh-release@v2". available inputs are "append_body", "body", "body_path", "discussion_category_name", "draft", "fail_on_unmatched_files", "files", "generate_release_notes", "make_latest", "name", "prerelease", "preserve_order", "repository", "tag_name", "target_commitish", "token"
(action)
🤖 Prompt for AI Agents