-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (116 loc) · 3.15 KB
/
Copy pathpublish.yaml
File metadata and controls
139 lines (116 loc) · 3.15 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Publish to PyPI
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build package
run: uv build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish-package:
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: read
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
publish-docs:
runs-on: ubuntu-latest
needs: [publish-package]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Sync dependencies
run: uv sync --group dev
- name: Deploy to GitHub Pages
run: uv run mkdocs gh-deploy --force
changelog:
runs-on: ubuntu-latest
needs: [publish-package]
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install git-cliff
uses: taiki-e/install-action@git-cliff
- name: Generate full changelog
run: git cliff -o CHANGELOG.md
- name: Generate release notes
run: git cliff --latest --strip header -o RELEASE_NOTES.md
- name: Create pull request for changelog
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
branch: changelog/${{ github.ref_name }}
title: "chore: update changelog for ${{ github.ref_name }}"
body: |
Automated changelog update for `${{ github.ref_name }}`.
commit-message: "chore: update changelog for ${{ github.ref_name }}"
add-paths: CHANGELOG.md
- name: Upload release notes
uses: actions/upload-artifact@v4
with:
name: release-notes
path: RELEASE_NOTES.md
github-release:
runs-on: ubuntu-latest
needs: [changelog]
permissions:
contents: write
steps:
- name: Download release notes
uses: actions/download-artifact@v4
with:
name: release-notes
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
files: dist/*