Skip to content

Commit

Permalink
chore: google play store 연동까지 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-ji-hoon committed Sep 29, 2024
1 parent 559d767 commit de59b49
Showing 1 changed file with 51 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Deploy New Version
name: Deploy New Version and Release to Play Store

on:
pull_request:
types: [ closed ]
# MR 머지 전에 push 했을 때 제대로 들어가는지 확인 후 주석 제거
# pull_request:
# types: [ closed ]

push:
branches:
- develop
- main
- feature/deploy-google-store

jobs:
versioning:
if: github.event.pull_request.merged == true
versioning_and_release:
runs-on: ubuntu-latest

# MR 머지 전에 push 했을 때 제대로 들어가는지 확인 후 주석 제거 if: github.event.pull_request.merged == true
environment: Release
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -33,24 +37,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check PR body
run: |
echo "PR Body: ${{ github.event.pull_request.body }}"
- name: Check ref
run: |
echo "PR ref: ${{ github.ref }} && Pr Head ref ${{ github.head_ref }}"
- name: Check latest PR comment
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
LAST_COMMENT=$(gh pr view $PR_NUMBER --comments --json comments --jq '.comments[-1].body')
echo "Last comment: $LAST_COMMENT"
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}



- name: Determine Version Release Type
id: version_type
run: |
Expand All @@ -77,7 +63,6 @@ jobs:
echo "Patch Version: ${{ steps.get-version.outputs.patch }}"
echo "Code: ${{ steps.get-version.outputs.code }}"
- name: Calculate New Version
id: calculate_version
run: |
Expand Down Expand Up @@ -123,3 +108,44 @@ jobs:
version_name=${{ steps.get-updated-version.outputs.version_name }}
git tag -a "v$version_name" -m "Version $version_name"
git push origin "v$version_name"
- name: Setup Development Environment
uses: ./.github/actions/setup-development-environment
with:
google-services: ${{ secrets.GOOGLE_SERVICES }}
test-mode: release
release-properties: ${{ secrets.RELEASE_PROPERTIES }}

- name: Setup Signed Key Environment
uses: ./.github/actions/setup-key-environment
with:
key-properties: ${{ secrets.KEY_PROPERTIES }}
key-file: ${{ secrets.SIGNED_KEY }}

- name: Build Release APK
run: ./gradlew :app:bundleRelease

- name: Check latest PR comment
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
LAST_COMMENT=$(gh pr view $PR_NUMBER --comments --json comments --jq '.comments[-1].body')
echo "Last comment: $LAST_COMMENT"
# Create a directory for "What's New"
mkdir -p distribution/whatsnew
# Create the file with the correct BCP 47 locale code (for example, en-US)
echo "$LAST_COMMENT" > distribution/whatsnew/whatsnew-ko-KR
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Check if AAB exists
run: ls -la app/build/outputs/bundle/release/

- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.FIREBASE_CREDENTIALS }}
packageName: com.pomonyang.mohanyang
releaseFiles: app/build/outputs/bundle/release/app-release.aab
whatsNewDirectory: distribution/whatsnew
track: internal
status: draft

0 comments on commit de59b49

Please sign in to comment.