Skip to content

Commit 2faaaab

Browse files
committed
add publish job
1 parent ee758f2 commit 2faaaab

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/poetry.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Python Package
33
on:
44
push:
55
branches: [master]
6+
tags:
7+
- v*
68
pull_request:
79
branches: [master]
810

@@ -29,3 +31,25 @@ jobs:
2931
3032
- name: Upload coverage to Codecov
3133
uses: codecov/codecov-action@v3
34+
35+
publish:
36+
runs-on: ubuntu-latest
37+
needs: test # 声明依赖于先前的测试作业
38+
if: startsWith(github.ref, 'refs/tags/') # 仅在标签推送时运行
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: 3.9
46+
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install poetry
51+
52+
- name: Publish package to PyPI
53+
run: |
54+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
55+
poetry publish --build --skip-existing

0 commit comments

Comments
 (0)