File tree Expand file tree Collapse file tree 5 files changed +70
-128
lines changed Expand file tree Collapse file tree 5 files changed +70
-128
lines changed Original file line number Diff line number Diff line change 18
18
default : patch
19
19
20
20
permissions :
21
- contents : write
21
+ contents : write # 用于创建和推送标签
22
+ pull-requests : write # 用于创建 PR
22
23
23
24
jobs :
24
25
setup :
Original file line number Diff line number Diff line change @@ -10,16 +10,23 @@ permissions:
10
10
contents : write # 用于部署到 GitHub Pages
11
11
12
12
jobs :
13
- setup :
14
- uses : ./.github/workflows/setup.yaml
15
- with :
16
- install-deps : docs
17
- secrets : inherit
18
-
19
13
deploy :
20
- needs : setup
21
14
runs-on : ubuntu-latest
22
15
steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Setup Python
20
+ uses : actions/setup-python@v5
21
+ with :
22
+ python-version : " 3.12"
23
+
24
+ - name : Install uv
25
+ uses : astral-sh/setup-uv@v5
26
+
27
+ - name : Install dependencies
28
+ run : uv sync --extra=docs
29
+
23
30
- name : Build and deploy documentation
24
31
run : uv run mkdocs gh-deploy --force
25
32
env :
Original file line number Diff line number Diff line change @@ -13,23 +13,26 @@ permissions:
13
13
pull-requests : write # 用于在 PR 中添加评论
14
14
15
15
jobs :
16
- setup :
17
- uses : ./.github/workflows/setup.yaml
18
- with :
19
- install-deps : dev
20
- python-version : " 3.12"
21
- secrets : inherit
22
-
23
16
check :
24
- needs : setup
25
17
runs-on : ubuntu-latest
26
18
steps :
27
19
- name : Checkout code
28
20
uses : actions/checkout@v4
29
21
22
+ - name : Setup Python
23
+ uses : actions/setup-python@v5
24
+ with :
25
+ python-version : " 3.12"
26
+
27
+ - name : Install uv
28
+ uses : astral-sh/setup-uv@v5
29
+
30
+ - name : Install dependencies
31
+ run : uv sync --extra=dev
32
+
30
33
- name : Run lint checks
31
34
id : lint
32
- run : uv tool run nox -s lint
35
+ run : uvx nox -s lint
33
36
continue-on-error : true
34
37
35
38
- name : Comment on PR (Lint)
54
57
55
58
- name : Run tests
56
59
id : test
57
- run : uv tool run nox -s test_all
60
+ run : uvx nox -s test_all
58
61
continue-on-error : true
59
62
60
63
- name : Upload coverage reports
Original file line number Diff line number Diff line change 1
- name : release_build
1
+ name : release-build
2
2
3
3
on :
4
4
push :
@@ -16,36 +16,51 @@ permissions:
16
16
id-token : write # 用于发布到 PyPI
17
17
18
18
jobs :
19
- setup :
20
- uses : ./.github/workflows/setup.yaml
21
- with :
22
- install-deps : dev
23
- python-version : " 3.12"
24
- secrets : inherit
25
-
26
- build :
27
- needs : setup
19
+ release-build :
28
20
runs-on : ubuntu-latest
21
+ permissions :
22
+ contents : write # 用于创建 GitHub Release
29
23
steps :
30
- - name : Run tests
31
- run : uvx nox -s test_all
24
+ - uses : actions/checkout@v4
32
25
33
- - name : Build package
34
- run : uvx nox -s build
26
+ - name : Load secret
27
+ uses : 1password/load-secrets-action@v2
28
+ with :
29
+ export-env : true
30
+ env :
31
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
32
+ PERSONAL_ACCESS_TOKEN : op://shawndengdev/github_access_token/credential
33
+ PYPI_TOKEN : op://shawndengdev/pypi_token/credential
35
34
36
- - name : Create Release
37
- id : create_release
38
- uses : softprops/action-gh-release@v2
35
+ - uses : actions/setup-python@v5
39
36
with :
40
- token : ${{ github.token }}
41
- tag_name : ${{ github.event.inputs.version || github.ref_name }}
42
- draft : false
43
- prerelease : false
44
- files : |
45
- dist/*
37
+ python-version : " 3.12"
38
+
39
+ - name : Install uv
40
+ uses : astral-sh/setup-uv@v5
41
+ with :
42
+ version : " >=0.4.0"
43
+
44
+ - name : Install dependencies
45
+ run : uv sync --extra dev
46
+
47
+ - name : Build and test
48
+ run : |
49
+ uvx nox -s lint
50
+ uvx nox -s test
51
+ uvx nox -s build
46
52
47
53
- name : Publish to PyPI
48
- uses : pypa/gh-action-pypi-publish@release/v1
54
+ env :
55
+ UV_PUBLISH_TOKEN : ${{ env.PYPI_TOKEN }}
56
+ run : uv publish
57
+
58
+ - name : Release
59
+ uses : softprops/action-gh-release@v2
49
60
with :
50
- packages-dir : dist/
51
- repository-url : https://upload.pypi.org/legacy/
61
+ files : |
62
+ dist/*.tar.gz
63
+ dist/*.whl
64
+ generate_release_notes : true
65
+ env :
66
+ GITHUB_TOKEN : ${{ env.PERSONAL_ACCESS_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments