Skip to content

Commit 856d2d5

Browse files
committed
separated workflows
1 parent e53c61f commit 856d2d5

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
push:
6+
tags: ["v*"]
7+
8+
jobs:
9+
publish-pypi-test:
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'push'
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.x"
20+
- name: Build package
21+
run: |
22+
python -m pip install build
23+
python -m build
24+
- name: Publish to TestPyPI
25+
uses: pypa/gh-action-pypi-publish@release/v1
26+
with:
27+
repository-url: https://test.pypi.org/legacy/
28+
29+
publish-prod:
30+
needs: publish-test
31+
runs-on: ubuntu-latest
32+
if: github.event_name == 'release'
33+
permissions:
34+
id-token: write
35+
contents: read
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.x"
41+
- name: Build package
42+
run: |
43+
python -m pip install build
44+
python -m build
45+
- name: Publish to PyPI
46+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)