Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions .github/workflows/discover-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Discover Libraries

on:
schedule:
# 매주 월요일 09:00 UTC (18:00 KST)에 실행
- cron: "0 9 * * 1"
# 매주 금요일 22:00 KST (13:00 UTC)에 실행
- cron: "0 13 * * 5"
workflow_dispatch:
inputs:
dry_run:
Expand All @@ -17,9 +17,6 @@ on:
default: "30"
type: string

env:
BUN_VERSION: "1.1.26"

jobs:
discover:
name: Discover New Libraries
Expand All @@ -32,7 +29,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/generate-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ on:
repository_dispatch:
types: [library-approved]

env:
BUN_VERSION: "1.1.26"

jobs:
generate-content:
name: Generate Library Content
Expand All @@ -42,7 +39,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down Expand Up @@ -70,10 +67,9 @@ jobs:
generate-playground:
name: Generate Playground Code
runs-on: ubuntu-latest
if: ${{ github.event.inputs.content_type == 'playground' || github.event.inputs.content_type == 'both' || github.event_name == 'repository_dispatch' }}
needs: [generate-content]
# Run even if content generation is skipped
if: always()
# Run even if content generation is skipped, but only for playground/both types
if: ${{ always() && (github.event.inputs.content_type == 'playground' || github.event.inputs.content_type == 'both' || github.event_name == 'repository_dispatch') }}

steps:
- name: Checkout repository
Expand All @@ -82,7 +78,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
143 changes: 143 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Create Release

on:
pull_request:
types: [closed]
branches: [main]

jobs:
release:
name: Create Release Note
runs-on: ubuntu-latest
# PR이 머지되었을 때만 실행 (close만 된 경우 제외)
if: github.event.pull_request.merged == true

steps:
- name: Checkout trey repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine Version Bump
id: bump
run: |
# PR 라벨에서 버전 타입 결정
LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}'

if echo "$LABELS" | grep -q '"major"'; then
echo "type=major" >> $GITHUB_OUTPUT
elif echo "$LABELS" | grep -q '"minor"'; then
echo "type=minor" >> $GITHUB_OUTPUT
elif echo "$LABELS" | grep -q '"patch"'; then
echo "type=patch" >> $GITHUB_OUTPUT
else
# 기본값: patch
echo "type=patch" >> $GITHUB_OUTPUT
fi

echo "Version bump type: $(cat $GITHUB_OUTPUT | grep type | cut -d= -f2)"

- name: Get Latest Version & Calculate New Version
id: version
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
# 최신 릴리즈 버전 가져오기
LATEST=$(gh release list --repo UseTrey/.github --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || echo "")

if [ -z "$LATEST" ] || [ "$LATEST" = "null" ]; then
# 첫 릴리즈
LATEST="v0.0.0"
fi

echo "Latest version: $LATEST"

# v 접두사 제거하고 파싱
VERSION="${LATEST#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"

# 숫자가 아니면 0으로 초기화
MAJOR=${MAJOR:-0}
MINOR=${MINOR:-0}
PATCH=${PATCH:-0}

# 버전 증가
BUMP_TYPE="${{ steps.bump.outputs.type }}"

case $BUMP_TYPE in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch)
PATCH=$((PATCH + 1))
;;
esac

NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: $NEW_VERSION"

- name: Get Commits Since Last Release
id: commits
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
# trey 레포의 최근 커밋들 가져오기
COMMITS=$(git log --oneline -20 --pretty=format:"- %s" 2>/dev/null | head -15)

# 멀티라인 출력 처리
echo "commits<<EOF" >> $GITHUB_OUTPUT
echo "$COMMITS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create Release on UseTrey/.github
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
VERSION: ${{ steps.version.outputs.new_version }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
MERGED_BY: ${{ github.event.pull_request.merged_by.login }}
BUMP_TYPE: ${{ steps.bump.outputs.type }}
COMMITS: ${{ steps.commits.outputs.commits }}
run: |
# Release notes 생성
NOTES=$(cat <<EOF
## 🚀 ${PR_TITLE}

**Version:** ${VERSION} (${BUMP_TYPE})
**PR:** [#${PR_NUMBER}](${PR_URL})
**Merged by:** @${MERGED_BY}
**Date:** $(TZ='Asia/Seoul' date +'%Y-%m-%d %H:%M KST')

### 📝 Changes
${COMMITS}

---

🔗 [Trey Website](https://trey.claychanwoo.com) | [Repository](https://github.com/UseTrey/trey)
EOF
)

# Release 생성
gh release create "$VERSION" \
--repo UseTrey/.github \
--title "Release $VERSION" \
--notes "$NOTES"

- name: Summary
run: |
echo "## ✅ Release Created" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Version:** ${{ steps.version.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Bump Type:** ${{ steps.bump.outputs.type }}" >> $GITHUB_STEP_SUMMARY
echo "- **Repository:** UseTrey/.github" >> $GITHUB_STEP_SUMMARY
echo "- **PR:** #${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "[View Release](https://github.com/UseTrey/.github/releases/tag/${{ steps.version.outputs.new_version }})" >> $GITHUB_STEP_SUMMARY
13 changes: 6 additions & 7 deletions .github/workflows/sync-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ jobs:
run: bun run build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3
with:
publish-dir: "./out"
production-deploy: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
npx netlify-cli deploy \
--prod \
--dir=.next \
--auth=${{ secrets.NETLIFY_AUTH_TOKEN }} \
--site=${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5
1 change: 1 addition & 0 deletions app/[slug]/detail-page-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function DetailPageClient({ data }: DetailPageClientProps) {
config={data.playground_config}
codeExample={data.code_example}
npmPackage={data.npm_package}
playgroundCode={data.playground_code}
/>
</section>

Expand Down
38 changes: 20 additions & 18 deletions app/admin/candidates/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { LibraryCandidateRow } from '@/lib/supabase/types';
function LoadingState() {
return (
<div className="flex items-center justify-center py-12">
<RefreshCw className="w-8 h-8 text-zinc-600 animate-spin" />
<RefreshCw className="w-8 h-8 text-muted-foreground animate-spin" />
</div>
);
}
Expand Down Expand Up @@ -44,15 +44,15 @@ function CandidatesContent() {
export default function CandidatesAdminPage() {
return (
<AuthGuard>
<div className="min-h-screen bg-zinc-950">
<div className="min-h-screen bg-background">
{/* 헤더 */}
<header className="border-b border-zinc-800 bg-zinc-900/50 backdrop-blur-sm sticky top-0 z-10">
<header className="border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-10">
<div className="max-w-5xl mx-auto px-4 py-4">
<div className="flex items-center gap-3">
<Settings className="w-6 h-6 text-zinc-400" />
<Settings className="w-6 h-6 text-muted-foreground" />
<div>
<h1 className="text-xl font-semibold text-white">후보 라이브러리 관리</h1>
<p className="text-sm text-zinc-500">
<h1 className="text-xl font-semibold text-foreground">후보 라이브러리 관리</h1>
<p className="text-sm text-muted-foreground">
자동 발견된 라이브러리를 검토하고 승인/거절합니다.
</p>
</div>
Expand All @@ -62,20 +62,22 @@ export default function CandidatesAdminPage() {
<nav className="flex gap-4 mt-4 text-sm">
<Link
href="/admin/scripts"
className="text-zinc-500 hover:text-white transition-colors"
className="text-muted-foreground hover:text-foreground transition-colors"
>
⚙️ 스크립트
</Link>
<span className="text-white border-b-2 border-white pb-1">후보 라이브러리</span>
<span className="text-foreground border-b-2 border-foreground pb-1">
후보 라이브러리
</span>
<Link
href="/admin/contents"
className="text-zinc-500 hover:text-white transition-colors"
className="text-muted-foreground hover:text-foreground transition-colors"
>
콘텐츠
</Link>
<Link
href="/admin/playgrounds"
className="text-zinc-500 hover:text-white transition-colors"
className="text-muted-foreground hover:text-foreground transition-colors"
>
Playground
</Link>
Expand All @@ -86,16 +88,16 @@ export default function CandidatesAdminPage() {
{/* 메인 콘텐츠 */}
<main className="max-w-5xl mx-auto px-4 py-8">
{/* 안내 메시지 */}
<div className="bg-zinc-900 border border-zinc-800 rounded-lg p-4 mb-6">
<h2 className="text-sm font-medium text-white mb-1">📋 검토 가이드</h2>
<ul className="text-sm text-zinc-400 space-y-1">
<div className="bg-card border border-border rounded-lg p-4 mb-6">
<h2 className="text-sm font-medium text-foreground mb-1">📋 검토 가이드</h2>
<ul className="text-sm text-muted-foreground space-y-1">
<li>
• <strong className="text-green-400">승인</strong>: 라이브러리가 Trey에 등록되고, AI
콘텐츠 생성이 시작됩니다.
</li>
<li>
• <strong className="text-red-400">거절</strong>: 라이브러리가 목록에서 제외되며,
같은 URL은 다시 발견되지 않습니다.
• <strong className="text-destructive">거절</strong>: 라이브러리가 목록에서
제외되며, 같은 URL은 다시 발견되지 않습니다.
</li>
<li>• 승인 기준: React/TypeScript 생태계, 활발한 유지보수, 충분한 문서화</li>
</ul>
Expand All @@ -108,10 +110,10 @@ export default function CandidatesAdminPage() {
</main>

{/* 푸터 */}
<footer className="border-t border-zinc-800 mt-auto">
<div className="max-w-5xl mx-auto px-4 py-4 text-center text-sm text-zinc-500">
<footer className="border-t border-border mt-auto">
<div className="max-w-5xl mx-auto px-4 py-4 text-center text-sm text-muted-foreground">
Trey Admin • 마지막 발견 실행:{' '}
<span className="text-zinc-400">{new Date().toLocaleDateString('ko-KR')}</span>
<span className="text-foreground/70">{new Date().toLocaleDateString('ko-KR')}</span>
</div>
</footer>
</div>
Expand Down
Loading
Loading