generated from Sunwood-ai-labs/HarmonAI_III
-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (82 loc) · 3.2 KB
/
generate-release-notes.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 自動GitHubリリースノート生成
on:
pull_request:
types: [closed]
branches:
- main
push:
tags:
- '*'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
issues: write
env:
GITHUB_TOKEN: ${{ secrets.YOUR_PERSONAL_ACCESS_TOKEN_IRIS}}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUB_REPOSITORY: ${{ github.repository }}
RELEASE_NOTES_DIR: ${{ github.workspace }}/.github/release_notes
HEADER_FONT: "DejaVu Math TeX Gyre"
YOUR_PERSONAL_ACCESS_TOKEN_IRIS: ${{ secrets.YOUR_PERSONAL_ACCESS_TOKEN_IRIS }}
jobs:
generate-release-notes:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: リポジトリのチェックアウト
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: タグの強制更新
run: |
git fetch --tags --force
git fetch origin main --force
git checkout main
git pull origin main
- name: 最新のタグを取得
id: get_tag
run: |
LATEST_TAG=$(git describe --tags --abbrev=0)
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_OUTPUT
- name: Python のセットアップ
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: 依存関係のインストール
run: |
python -m pip install --upgrade pip
pip install -r .github/requirements.txt
pip install Pillow loguru matplotlib
- name: アセットディレクトリの確認
run: |
mkdir -p .github/release_notes/assets
ls -la .github/release_notes/assets
mkdir -p docs/release_notes/header_image
ls -la docs/release_notes/header_image
- name: SourceSage の実行
run: |
sourcesage --ignore-file=".github/repository_summary/.iris.SourceSageignore"
- name: ヘッダー画像の生成
id: generate_header
run: |
python .github/scripts/generate_header_image.py
env:
LATEST_TAG: ${{ steps.get_tag.outputs.LATEST_TAG }}
- name: ヘッダー画像のコミットとプッシュ
run: |
git config --global user.name "iris-s-coon"
git config --global user.email "[email protected]"
git add docs/release_notes/header_image/release_header_${{ steps.get_tag.outputs.LATEST_TAG }}.png
git add docs/release_notes/header_image/release_header_latest.png
git commit -m "🖼 ヘッダー画像の更新: ${{ steps.get_tag.outputs.LATEST_TAG }}"
git push
- name: GitHubリリースノートの生成
env:
LATEST_TAG: ${{ steps.get_tag.outputs.LATEST_TAG }}
# HEADER_IMAGE_URL: "https://raw.githubusercontent.com/${{ github.repository }}/main/docs/release_notes/header_image/release_header_${{ steps.get_tag.outputs.LATEST_TAG }}.png"
run: |
python .github/scripts/generate_github_release_notes.py