Skip to content

Commit 4ad0a87

Browse files
committed
Update GitHub workflow
1 parent f00bd35 commit 4ad0a87

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
push
1010

1111
jobs:
12-
build-n-publish:
13-
name: Build and publish to PyPI
12+
build:
13+
name: Build package
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
@@ -26,12 +26,30 @@ jobs:
2626
- name: Build package
2727
run: |
2828
python -m build
29+
- name: Upload dist files
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: dist-files
33+
path: dist/
34+
if-no-files-found: error
35+
publish:
36+
name: Publish to PyPI
37+
runs-on: ubuntu-latest
38+
needs: build-n-publish
39+
steps:
40+
- name: Download dist files
41+
uses: actions/download-artifact@v2
42+
with:
43+
name: dist-files
44+
path: dist/
2945
- name: Publish package to Test PyPI
3046
uses: pypa/gh-action-pypi-publish@release/v1
3147
with:
48+
user: __token__
3249
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
3350
- name: Publish package to PyPI
3451
if: startsWith(github.ref, 'refs/tags')
3552
uses: pypa/gh-action-pypi-publish@release/v1
3653
with:
54+
user: __token__
3755
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)