-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (71 loc) · 2.95 KB
/
sync-release.yml
File metadata and controls
82 lines (71 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Sync Release Docs
on:
workflow_dispatch:
inputs:
version:
description: 'Released version'
required: true
base_tag:
description: 'Base tag (5 releases ago)'
required: true
recent_tags:
description: 'Recent 5 tags (comma-separated)'
required: true
changed_files:
description: 'Changed files since base tag'
required: true
permissions:
contents: write
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch t-ruby source
run: |
git clone https://github.com/type-ruby/t-ruby.git /tmp/t-ruby
cd /tmp/t-ruby
git fetch --tags
- name: Generate diff context (last 5 releases)
run: |
cd /tmp/t-ruby
git diff ${{ inputs.base_tag }}..v${{ inputs.version }} > /tmp/release_diff.txt
git log ${{ inputs.base_tag }}..v${{ inputs.version }} --oneline > /tmp/commit_log.txt
git show v${{ inputs.version }}:CHANGELOG.md > /tmp/current_changelog.txt
- name: Update docs with Claude Code
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
t-ruby v${{ inputs.version }}이 릴리스되었습니다.
## 컨텍스트
- 컴파일러 소스: /tmp/t-ruby
- 현재 저장소: 문서 사이트 (t-ruby.github.io)
- 현재 릴리스: v${{ inputs.version }}
- 분석 범위: 최근 5개 릴리스 (${{ inputs.recent_tags }})
- 비교 시작점: ${{ inputs.base_tag }}
- 변경된 파일 목록: ${{ inputs.changed_files }}
- 상세 diff: /tmp/release_diff.txt
- 커밋 로그: /tmp/commit_log.txt
- 현재 CHANGELOG: /tmp/current_changelog.txt
## 작업
1. static/version.json의 compiler 버전을 ${{ inputs.version }}으로 업데이트
2. /tmp/t-ruby/CHANGELOG.md를 docs/project/changelog.md로 동기화
3. 최근 5개 릴리스의 변경사항을 분석하여 문서 업데이트:
- 새 기능 추가 → 관련 문서 생성/수정
- API 변경 → 레퍼런스 업데이트
- 기능 제거 → 문서 삭제 또는 deprecated 표시
- 이전 릴리스에서 누락된 문서 변경도 보완
4. 다국어(i18n/ko, i18n/ja) 문서도 필요시 업데이트
변경사항이 있으면 커밋해주세요.
- name: Push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "docs: sync v${{ inputs.version }} release"
git push origin main
fi