Skip to content

Commit

Permalink
Merge branch 'main' into be/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jongmee authored Nov 14, 2024
2 parents 1d3604b + 2c7f440 commit 3fc31d7
Show file tree
Hide file tree
Showing 629 changed files with 28,387 additions and 213 deletions.
81 changes: 81 additions & 0 deletions .github/actions/add_labels/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Add Labels Action

description: "Add labels to a pull request based on its title"

inputs:
title:
description: "title of the pull request or issue"
required: true

runs:
using: 'composite'
steps:

- name: Input title
shell: bash
run: |
echo "Input Title: ${{ inputs.title }}"
- name: add FEAT ✨ labels
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'FEAT') }}
with:
labels: |
AN_FEAT ✨
- name: add UI 🎨 labels
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'UI') }}
with:
labels: |
AN_UI 🎨
- name: add REFACTOR ✍️ label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'REFACTOR') }}
with:
labels: |
AN_REFACTOR ✍️
- name: add FIX 🐛 label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'FIX') }}
with:
labels: |
AN_FIX 🐛
- name: add CI/CD 🤖 label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'CI') || contains(inputs.title, 'CD') }}
with:
labels: |
AN_CI/CD 🤖
- name: add CONFIG 🧭 label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ contains(inputs.title, 'CONFIG') }}
with:
labels: |
AN_CONFIG 🧭
- name: Extract Version Name
shell: bash
env:
title: ${{ inputs.title }}
run: |
version=$(echo '${{ env.title }}' | grep -oP '\d+\.\d+\.\d+')
if [ -z "$version" ]; then
echo "No version found in the title."
echo "version=none" >> $GITHUB_ENV
else
echo "version=v$version" >> $GITHUB_ENV
fi
- name: Add version 🏷️ label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ env.version != 'none' }} # 버전이 존재할 때만 실행
with:
labels: |
${{ env.version }} 🏷️
50 changes: 50 additions & 0 deletions .github/actions/ktlint_check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 'ktLint Check'

description: 'Run ktLint Check using Gradle'

inputs:
POKE_BASE_URL:
description: 'Base URL for local.properties'
required: true


runs:
using: 'composite'
steps:

- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Local Properties
shell: bash
run: touch local.properties
working-directory: ./android

- name: Access Local Properties
shell: bash
run: |
echo POKE_BASE_URL=\"${{ inputs.POKE_BASE_URL }}\" >> local.properties
working-directory: ./android

- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew
working-directory: ./android

- name: Lint Check
shell: bash
run: ./gradlew ktlintCheck
working-directory: ./android
10 changes: 10 additions & 0 deletions .github/actions/reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
addReviewers: true
addAssignees: author

reviewers:
- kkosang
- sh1mj1
- murjune
- JoYehyun99

numberOfReviewers: 3
71 changes: 71 additions & 0 deletions .github/actions/unit_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 'Test Alpha Unit Test'

description: 'Run Alpha Unit Tests using Gradle'

inputs:
POKE_BASE_URL:
description: 'Base URL for local.properties'
required: true
GOOGLE_SERVICES_ALPHA:
description: 'Google Services JSON for alpha build'
required: true
GOOGLE_SERVICES_BETA:
description: 'Google Services JSON for beta build'
required: true
GOOGLE_SERVICES:
description: 'Google Services JSON for release'
required: true

runs:
using: 'composite'

steps:
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Google-Services.json
shell: bash
run: |
touch ./android/app/src/debug/google-services.json
touch ./android/app/src/alpha/google-services.json
touch ./android/app/src/beta/google-services.json
mkdir ./android/app/src/release
touch ./android/app/src/release/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_ALPHA }} >> ./android/app/src/debug/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_ALPHA }} >> ./android/app/src/alpha/google-services.json
echo ${{ inputs.GOOGLE_SERVICES_BETA }} >> ./android/app/src/beta/google-services.json
echo ${{ inputs.GOOGLE_SERVICES }} >> ./android/app/src/release/google-services.json
- name: Create Local Properties
shell: bash
run: touch local.properties
working-directory: ./android

- name: Access Local Properties
shell: bash
run: |
echo POKE_BASE_URL=\"${{ inputs.POKE_BASE_URL }}\" >> local.properties
working-directory: ./android

- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew
working-directory: ./android

- name: Run Alpha Unit Tests
shell: bash
run: ./gradlew testAlphaUnitTest
working-directory: ./android
10 changes: 10 additions & 0 deletions .github/an_pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- closed #이슈넘버
## 작업 영상

## 작업한 내용
-

## PR 포인트
-

## 🚀Next Feature
126 changes: 126 additions & 0 deletions .github/workflows/Android_Develop_CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Android PR Builder

on:
pull_request:
types:
- closed
branches: [ an/develop ]

defaults:
run:
working-directory: ./android

jobs:
CI_Android_Develop:
uses: ./.github/workflows/Android_Develop_CI.yml
secrets: inherit

Distribution_To_Discord:
name: Alpha APK to Discord
runs-on: ubuntu-latest
needs: [ CI_Android_Develop ]
steps:
- uses: actions/checkout@v4
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Create Google-Services.json
env:
GOOGLE_SERVICES_ALPHA: ${{ secrets.GOOGLE_SERVICES_ALPHA }}
GOOGLE_SERVICES_BETA: ${{ secrets.GOOGLE_SERVICES_BETA }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/debug/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/alpha/google-services.json
echo $GOOGLE_SERVICES_BETA >> ./app/src/beta/google-services.json
echo $GOOGLE_SERVICES >> ./app/src/release/google-services.json
- name: Check google-services.json content
run: cat ./app/src/debug/google-services.json

- name: Create Local Properties
run: touch local.properties

- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build alpha APK
run: ./gradlew assembleAlpha

- name: Upload alpha APK artifact
uses: actions/upload-artifact@v4
with:
name: android-artifact
path: android/app/build/outputs/apk/alpha/
if-no-files-found: error

- name: Check APK existence
run: ls -al app/build/outputs/apk/alpha/

- name: Extract Version Name
env:
title: ${{ github.event.pull_request.title }}
run: |
version=$(echo '${{ env.title }}' | grep -oP '\d+\.\d+\.\d+')
echo "version=v$version" >> $GITHUB_ENV
- name: Send alpha version APK to Discord with Embeds
env:
DISCORD_WEBHOOK_URL: ${{ secrets.AlPHA_APK_DISCORD_WEB_HOOK }}
VERSION: ${{ env.version }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
CONTENT="최신 개발 버전 APK 가 나왔어요!🎉
[배포 버전] : $VERSION!
[해당 PR 제목] : $PR_TITLE"
EMBED=$(jq -n \
--arg title "PR Merged: $PR_TITLE" \
--arg url "$PR_URL" \
--arg description "Version: $VERSION 🎉" \
'{
"title": $title,
"url": $url,
"description": $description,
"color": 3066993
}'
)
PAYLOAD=$(jq -n \
--arg content "$CONTENT" \
--argjson embeds "[$EMBED]" \
'{
"content": $content,
"embeds": $embeds
}'
)
curl -F "payload_json=$PAYLOAD" \
-F "file=@app/build/outputs/apk/alpha/app-alpha.apk" \
$DISCORD_WEBHOOK_URL
Loading

0 comments on commit 3fc31d7

Please sign in to comment.