Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
36381bd
feat: Poetry로 프로젝트 초기화 #1
apaals2 Jul 5, 2025
a3f86a2
chore: FastAPI Uvicorn 설치 #1
apaals2 Jul 5, 2025
4f6ebed
feat: 초기 FastAPI 앱 구현 및 헬스체크 #1
apaals2 Jul 5, 2025
36c90f2
feat(dev-deps): Ruff, Black, pre-commit 추가 및 설정 #1
apaals2 Jul 5, 2025
1977958
Merge pull request #3 from AskQL/feature/init
hyeong8465 Jul 5, 2025
f8529f6
chore(ci): OS별 실행파일 자동 빌드 및 배포 설정 #2
apaals2 Jul 6, 2025
4a83e48
chore(ci): workfolws에서 poetry 설치 추가
apaals2 Jul 6, 2025
87f5887
chore(ci): poetry 설치 명령어 수정
apaals2 Jul 6, 2025
bf4efb6
chore(ci): poetry 설치 오류 디버깅
apaals2 Jul 6, 2025
c7f540e
chore(ci): poetry 환경 변수 경로 직접추가 #2
apaals2 Jul 6, 2025
bd21f43
chore(ci): poetry 설치 순서 변경 #2
apaals2 Jul 6, 2025
69cc21d
chore(ci): pyinstaller 설치 명령어 수정
apaals2 Jul 6, 2025
285be15
fix(ci): main.py 경로 수정으로 PyInstaller 빌드 오류 해결
apaals2 Jul 6, 2025
02f589d
fix(ci): windows에서 Poetry 설치 시 bash shell 사용으로 오류 해결 #2
apaals2 Jul 6, 2025
a5a3f1b
chore(ci): OS별 poetry 설치 환경 변수 경로 수정
apaals2 Jul 6, 2025
70dd28f
feat(ci): Uvicorn 동적 포트 할당 추가 #2
apaals2 Jul 6, 2025
a5f67c8
Merge pull request #4 from AskQL/feature/pipeline
apaals2 Jul 6, 2025
737ad55
docs: README.md 수정
apaals2 Jul 6, 2025
ac7e642
fix: poetry install 에러 해결용 패키지 폴더 추가 및 팀명 수정으로 인한pyproject.toml 파일 수정
apaals2 Jul 10, 2025
0c5b87e
docs: README.md 수정
apaals2 Jul 10, 2025
1662eaf
feat: discord 봇 도입(pr, 배포)
ChoiSeungWoo98 Jul 17, 2025
8347ec8
fix: 액션 주소를 참조하지 못해 주소 수정
ChoiSeungWoo98 Jul 17, 2025
c2dbc7b
fix: 외부 액션 제외하고 자체적으로 하도록 변경
ChoiSeungWoo98 Jul 17, 2025
b7cbde9
discord 봇 도입(pr, 배포)
ChoiSeungWoo98 Jul 17, 2025
c0e2272
chore: 툴 설정 파일 이그노어 처리
ChoiSeungWoo98 Jul 17, 2025
96d187d
fix: 오타 수정
ChoiSeungWoo98 Jul 17, 2025
bac422e
Merge remote-tracking branch 'origin/feature/bot' into develop
ChoiSeungWoo98 Jul 17, 2025
ea895f7
refactor: 오타 수정
ChoiSeungWoo98 Jul 17, 2025
75c4131
Merge pull request #10 from Queryus/feature/bot
ChoiSeungWoo98 Jul 17, 2025
0b4ecbd
style: 디스코드 봇 알람 형식 및 색상 변경
ChoiSeungWoo98 Jul 18, 2025
142f0a9
Merge pull request #11 from Queryus/feature/bot
ChoiSeungWoo98 Jul 18, 2025
67d5607
style: 디스코드 봇 알람 형식 및 색상 변경
ChoiSeungWoo98 Jul 18, 2025
7c77a5a
Merge remote-tracking branch 'origin/feature/bot' into develop
ChoiSeungWoo98 Jul 18, 2025
fa9901a
fix: 댓글 가져오지 않는 거 수정
ChoiSeungWoo98 Jul 18, 2025
3c1679e
Merge remote-tracking branch 'origin/feature/bot' into develop
ChoiSeungWoo98 Jul 18, 2025
55ea92a
style: 댓글 색상 수정
ChoiSeungWoo98 Jul 18, 2025
405ad99
Merge remote-tracking branch 'origin/feature/bot' into develop
ChoiSeungWoo98 Jul 18, 2025
e8f0326
docs: Askql 수정
ChoiSeungWoo98 Jul 18, 2025
0f659eb
style: 디스코드 줄바꿈 추가
ChoiSeungWoo98 Jul 18, 2025
eb2d582
Merge pull request #13 from Queryus/feature/initalize
ChoiSeungWoo98 Jul 18, 2025
1e595ad
style: 노출 멘트 수정
ChoiSeungWoo98 Jul 18, 2025
729845a
Merge pull request #14 from Queryus/feature/bot
ChoiSeungWoo98 Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 177 additions & 0 deletions .github/workflows/build_release_and_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# .github/workflows/build_release_and_notify.yml

name: Build and Deploy Executables

on:
release:
types: [published] # Release가 'published' 상태가 될 때 트리거

jobs:
# ==================================
# 파이프라인 시작 알림
# ==================================
start:
runs-on: ubuntu-latest
steps:
- name: Send Pipeline Start Notification
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "API 배포 봇",
"embeds": [{
"description": "**${{ github.ref_name }}** API 배포를 시작합니다.",
"color": 2243312
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
# ==================================
# 실행 파일 빌드
# ==================================
build:
needs: start
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
# 1. Git 리포지토리의 소스 코드를 가져옵니다.
- name: Checkout code
uses: actions/checkout@v4

# 2. Poetry 설치 (디버깅 출력 추가)
- name: Install Poetry
shell: bash
run: |
curl -sSL https://install.python-poetry.org | python3 -
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "C:/Users/runneradmin/AppData/Roaming/Python/Scripts" >> $GITHUB_PATH
else
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi

# 3. Poetry를 사용하여 파이썬 환경을 설정합니다.
- name: Set up Python with Poetry
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"

# 4. Poetry 의존성(PyInstaller 포함)을 설치합니다.
- name: Install Poetry dependencies
run: poetry install --no-root

# 5. OS에 따라 실행 파일의 이름(.exe 확장자 등)을 결정합니다.
- name: Set executable name
id: set_name
shell: bash
run: |
if [ "${{ runner.os }}" == "macOS" ]; then
echo "EXE_NAME=qgenie-api" >> $GITHUB_ENV
elif [ "${{ runner.os }}" == "Windows" ]; then
echo "EXE_NAME=qgenie-api.exe" >> $GITHUB_ENV
fi

# 6. PyInstaller를 사용해 파이썬 코드를 실행 파일로 만듭니다.
- name: Build executable with PyInstaller
run: poetry run pyinstaller main.py --name ${{ env.EXE_NAME }} --onefile --noconsole

# 7. 빌드된 실행 파일을 다음 단계(deploy)에서 사용할 수 있도록 아티팩트로 업로드합니다.
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: executable-${{ runner.os }}
path: dist/${{ env.EXE_NAME }}
retention-days: 1

# ==================================
# 배포
# ==================================
deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout App Repository
uses: actions/checkout@v4
with:
repository: Queryus/QGenie_app
token: ${{ secrets.PAT_FOR_FRONT_REPO }}
ref: develop

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Organize files
run: |
mkdir -p resources/mac resources/win
mv artifacts/executable-macOS/qgenie-api resources/mac/
mv artifacts/executable-Windows/qgenie-api.exe resources/win/

- name: Commit and push changes
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit to QGenie APP repository."
else
git commit -m "feat: API 실행 파일 업데이트 (${{ github.ref_name }})"
git push
fi

# ==================================
# 파이프라인 최종 결과 알림
# ==================================
finish:
needs: deploy
runs-on: ubuntu-latest
if: always()

steps:
- name: Send Success Notification
if: needs.deploy.result == 'success'
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "API 배포 봇",
"embeds": [{
"title": "New API Release: ${{ github.ref_name }}",
"url": "${{ github.event.release.html_url }}",
"description": "**${{ github.ref_name }}** API 배포가 성공적으로 완료되었습니다!",
"color": 5167473
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Failure Notification
if: contains(needs.*.result, 'failure')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "API 배포 봇",
"embeds": [{
"title": "API 배포 실패",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "**${{ github.ref_name }}** API 배포 중 오류가 발생했습니다.",
"color": 15219495
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

- name: Send Skipped or Cancelled Notification
if: contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "API 배포 봇",
"embeds": [{
"title": "API 배포 미완료",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"description": "**${{ github.ref_name }}** API 배포가 완료되지 않았습니다. (상태: 취소 또는 건너뜀)\n이전 단계에서 문제가 발생했을 수 있습니다.",
"color": 16577629
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
86 changes: 86 additions & 0 deletions .github/workflows/pr_bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# .github/workflows/pr_bot.yml
name: Pull Request Bot

on:
# Pull Request 관련 이벤트 발생 시
pull_request:
types: [opened, closed, reopened, synchronize]
issue_comment:
types: [created]

jobs:
notify:
runs-on: ubuntu-latest
steps:
# -------------------------
# 생성/동기화 알림
# -------------------------
- name: Send PR Created Notification
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize')
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub PR 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}",
"description": "**${{ github.actor }}**님이 Pull Request를 생성하거나 업데이트했습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 2243312
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 댓글 알림
# -------------------------
- name: Send PR Comment Notification
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
run: |
COMMENT_BODY=$(echo "${{ github.event.comment.body }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
curl -X POST -H "Content-Type: application/json" \
-d "{
\"username\": \"GitHub 댓글 봇\",
\"embeds\": [{
\"title\": \"New Comment on PR #${{ github.event.issue.number }}\",
\"description\": \"**${{ github.actor }}**님의 새 댓글: \\n${COMMENT_BODY}\",
\"url\": \"${{ github.event.comment.html_url }}\",
\"color\": 15105570
}]
}" \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 머지(Merge) 알림
# -------------------------
- name: Send PR Merged Notification
if: github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub Merge 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }} Merged!",
"description": "**${{ github.actor }}**님이 **${{ github.event.pull_request.title }}** PR을 머지했습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 5167473
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

# -------------------------
# 닫힘(Close) 알림
# -------------------------
- name: Send PR Closed Notification
if: github.event.action == 'closed' && github.event.pull_request.merged == false
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"username": "GitHub PR 봇",
"embeds": [{
"title": "Pull Request #${{ github.event.pull_request.number }} Closed",
"description": "**${{ github.actor }}**님이 **${{ github.event.pull_request.title }}** PR을 닫았습니다.",
"url": "${{ github.event.pull_request.html_url }}",
"color": 15219495
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
57 changes: 57 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Python 생성 파일
__pycache__/ # 파이썬 캐시 디렉토리
**/__pycache__/
*.pyc # 컴파일된 바이트코드 파일
*.pyo
*.pyd
.Python # 가상환경 관련 숨김 파일

# 가상환경 폴더 (Poetry, venv 등)
env/
venv/
.venv/ # Poetry가 생성하는 가상환경 폴더

# IDE 설정 파일
.vscode/ # VSCode 개인 설정

# Poetry
# poetry.lock은 반드시 공유
*.lock
!poetry.lock

# 데이터베이스 파일
*.db
*.sqlite
*.sqlite3

# 로그 및 임시 파일
*.log
*.tmp
tmp/
temp/

# 운영체제 및 기타 불필요한 파일
.DS_Store # macOS에서 생성되는 메타파일
Thumbs.db # Windows에서 생성되는 파일
desktop.ini # Windows 바탕화면 설정 파일
.idea
.vscode

# 테스트 커버리지 리포트
htmlcov/
.tox/
.coverage
.cache/
.pytest_cache/

# 빌드/배포 디렉토리
dist/
build/
*.egg-info/

# 환경 변수 파일 (보안 이슈)
.env # 환경 변수 파일
.env.*

# Jupyter Notebook 체크포인트 (혹시 사용 시)
#.ipynb_checkpoints/
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.2" # ruff 버전에 맞게 수정
hooks:
- id: ruff
args: ["--fix"] # 자동 수정 적용

- repo: https://github.com/psf/black
rev: "25.1.0" # black 버전에 맞게
hooks:
- id: black
language_version: python3.11
Loading