-
Notifications
You must be signed in to change notification settings - Fork 59
43 lines (36 loc) · 1.08 KB
/
publish.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
name: Publish to PyPI
on:
release:
types:
- published
jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
if: "startsWith(github.event.release.tag_name, 'v')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: .github/workflows/.python-version
- name: Install build dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1.5
if: "github.event.release.prerelease"
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
print_hash: true
skip_existing: true
verbose: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.5
if: "!github.event.release.prerelease"
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true