-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from Nexters/develop
Release/0.1.5
- Loading branch information
Showing
16 changed files
with
465 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains 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,15 @@ | ||
## RELEASE 모하냥 | ||
|
||
> 해당하는 업데이트 사항을 선택해주세요: | ||
- [ ] Major | ||
- [ ] Minor | ||
- [ ] Patch | ||
|
||
## 설명 | ||
|
||
이 PR에 포함된 변경 사항을 간략히 설명해주세요. | ||
|
||
## 체크리스트 | ||
|
||
- [ ] 체크 해야 하는 내용 |
This file contains 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,39 @@ | ||
name: 'Get App Version' | ||
description: 'Get App Version' | ||
|
||
outputs: | ||
major: | ||
description: "앱 버전 중 major" | ||
value: ${{ steps.get-app-version.outputs.major }} | ||
minor: | ||
description: "앱 버전 중 minor" | ||
value: ${{ steps.get-app-version.outputs.minor }} | ||
patch: | ||
description: "앱 버전 중 patch" | ||
value: ${{ steps.get-app-version.outputs.patch }} | ||
code: | ||
description: "앱 버전 코드" | ||
value: ${{ steps.get-app-version.outputs.code }} | ||
version_name: | ||
description: "앱 버전 이름" | ||
value: ${{ steps.get-app-version.outputs.version_name }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get App Version | ||
id: get-app-version | ||
shell: bash | ||
run: | | ||
major=$(jq .major app-version.json) | ||
minor=$(jq .minor app-version.json) | ||
patch=$(jq .patch app-version.json) | ||
code=$(jq .code app-version.json) | ||
{ | ||
echo "major=$major" | ||
echo "minor=$minor" | ||
echo "patch=$patch" | ||
echo "code=$code" | ||
echo "version_name=$major.$minor.$patch" | ||
} >> $GITHUB_OUTPUT |
This file contains 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,47 @@ | ||
name: "Update App Version" | ||
|
||
inputs: | ||
major: | ||
description: "업데이트 할 앱 major" | ||
required: true | ||
minor: | ||
description: "업데이트 할 앱 버전 minor" | ||
required: true | ||
patch: | ||
description: "업데이트 할 앱 버전 patch" | ||
required: true | ||
code: | ||
description: "업데이트 할 앱 버전 code" | ||
required: true | ||
file: | ||
description: "업데이트 할 파일 경로" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Update app version | ||
shell: bash | ||
if: success() | ||
run: | | ||
VERSION_FILE="${{ inputs.file }}" | ||
if command -v jq &> /dev/null; then | ||
# jq가 설치되어 있는 경우 | ||
jq '.major = $major | .minor = $minor | .patch = $patch | .code = $code' \ | ||
--argjson major "${{ inputs.major }}" \ | ||
--argjson minor "${{ inputs.minor }}" \ | ||
--argjson patch "${{ inputs.patch }}" \ | ||
--argjson code "${{ inputs.code }}" \ | ||
$VERSION_FILE > tmp.$$.json && mv tmp.$$.json $VERSION_FILE | ||
else | ||
# jq가 설치되어 있지 않은 경우 | ||
sed -i "s/\"major\": [0-9]\+/\"major\": ${{ inputs.major }}/" $VERSION_FILE | ||
sed -i "s/\"minor\": [0-9]\+/\"minor\": ${{ inputs.minor }}/" $VERSION_FILE | ||
sed -i "s/\"patch\": [0-9]\+/\"patch\": ${{ inputs.patch }}/" $VERSION_FILE | ||
sed -i "s/\"code\": [0-9]\+/\"code\": ${{ inputs.code }}/" $VERSION_FILE | ||
fi | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add $VERSION_FILE | ||
git commit -m "Update app version to ${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} [${{ inputs.code }}]" | ||
git push |
This file contains 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,148 @@ | ||
name: Deploy New Version and Release to Play Store | ||
|
||
on: | ||
pull_request: | ||
types: [ closed ] | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
versioning_and_release: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
environment: Release | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install jq | ||
run: sudo apt-get install jq -y | ||
|
||
- name: Install GitHub CLI | ||
run: sudo apt-get install -y gh | ||
|
||
- name: Authenticate GitHub CLI | ||
run: | | ||
gh auth setup-git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Determine Version Release Type | ||
id: version_type | ||
run: | | ||
pr_body=$(echo "${{ github.event.pull_request.body }}" | tr '[:upper:]' '[:lower:]') | ||
if echo "$pr_body" | grep -q '\[x\].*major'; then | ||
echo "release_type=major" >> $GITHUB_ENV | ||
elif echo "$pr_body" | grep -q '\[x\].*minor'; then | ||
echo "release_type=minor" >> $GITHUB_ENV | ||
elif echo "$pr_body" | grep -q '\[x\].*patch'; then | ||
echo "release_type=patch" >> $GITHUB_ENV | ||
else | ||
echo "release_type=patch" >> $GITHUB_ENV | ||
fi | ||
- name: Get App Version | ||
uses: ./.github/actions/get-app-version | ||
id: get-version | ||
|
||
- name: Echo Current App Version | ||
run: | | ||
echo "App Version: ${{ steps.get-version.outputs.version_name }}" | ||
echo "Major Version: ${{ steps.get-version.outputs.major }}" | ||
echo "Minor Version: ${{ steps.get-version.outputs.minor }}" | ||
echo "Patch Version: ${{ steps.get-version.outputs.patch }}" | ||
echo "Code: ${{ steps.get-version.outputs.code }}" | ||
- name: Calculate New Version | ||
id: calculate_version | ||
run: | | ||
major=${{ steps.get-version.outputs.major }} | ||
minor=${{ steps.get-version.outputs.minor }} | ||
patch=${{ steps.get-version.outputs.patch }} | ||
code=${{ steps.get-version.outputs.code }} | ||
if [ "$release_type" = "major" ]; then | ||
major=$((major + 1)) | ||
minor=0 | ||
patch=0 | ||
elif [ "$release_type" = "minor" ]; then | ||
minor=$((minor + 1)) | ||
patch=0 | ||
else | ||
patch=$((patch + 1)) | ||
fi | ||
code=$((code + 1)) | ||
echo "major=${major}" >> $GITHUB_OUTPUT | ||
echo "minor=${minor}" >> $GITHUB_OUTPUT | ||
echo "patch=${patch}" >> $GITHUB_OUTPUT | ||
echo "code=${code}" >> $GITHUB_OUTPUT | ||
echo "version_name=${major}.${minor}.${patch}" >> $GITHUB_OUTPUT | ||
- name: Update App Version | ||
uses: ./.github/actions/update-app-version | ||
with: | ||
major: ${{ steps.calculate_version.outputs.major }} | ||
minor: ${{ steps.calculate_version.outputs.minor }} | ||
patch: ${{ steps.calculate_version.outputs.patch }} | ||
code: ${{ steps.calculate_version.outputs.code }} | ||
file: "app-version.json" | ||
|
||
- name: Get Updated App Version | ||
id: get-updated-version | ||
uses: ./.github/actions/get-app-version | ||
|
||
- name: Create Git Tag | ||
run: | | ||
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 |
This file contains 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,41 @@ | ||
name: "[CD] Debug to Firebase Distribution" | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy_debug: | ||
environment: Debug | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Development Environment | ||
uses: ./.github/actions/setup-development-environment | ||
with: | ||
google-services: ${{ secrets.GOOGLE_SERVICES }} | ||
test-mode: debug | ||
debug-properties: ${{ secrets.DEBUG_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 Debug APK | ||
run: ./gradlew :app:assembleDebug | ||
|
||
- name: Check if APK exists | ||
run: ls -la app/build/outputs/apk/debug/ | ||
|
||
- name: Upload to Firebase App Distribution | ||
uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
with: | ||
appId: ${{secrets.FIREBASE_APP_ID}} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIALS }} | ||
groups: 뽀모냥 | ||
file: app/build/outputs/apk/debug/app-debug.apk |
41 changes: 41 additions & 0 deletions
41
.github/workflows/deploy_firebase-distribution_release.yml
This file contains 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,41 @@ | ||
name: "[CD] Release to Firebase Distribution" | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy_release: | ||
environment: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- 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:assembleRelease | ||
|
||
- name: Check if APK exists | ||
run: ls -la app/build/outputs/apk/release/ | ||
|
||
- name: Upload to Firebase App Distribution | ||
uses: wzieba/Firebase-Distribution-Github-Action@v1 | ||
with: | ||
appId: ${{secrets.FIREBASE_APP_ID}} | ||
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIALS }} | ||
groups: 뽀모냥 | ||
file: app/build/outputs/apk/release/app-release.apk |
This file contains 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,6 @@ | ||
{ | ||
"major": 0, | ||
"minor": 1, | ||
"patch": 4, | ||
"code": 12 | ||
} |
This file contains 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 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.