Skip to content

Commit 97ba9ac

Browse files
authored
Create workflow
1 parent 7048488 commit 97ba9ac

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/pypi.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 📦 to PyPI and TestPyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- test
7+
8+
jobs:
9+
build-and-publish:
10+
if: startsWith(github.ref, 'refs/tags/*')
11+
name: Build and publish 📦 to PyPI
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.8
19+
- name: Install pypa/build
20+
run: |
21+
python -m pip install build --user
22+
- name: Build a binary wheel and a source tarball
23+
run: |
24+
python3 -m build
25+
- name: Publish distribution 📦 to Test PyPI
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
password: ${{ secrets.testpypi }}
29+
repository_url: https://test.pypi.org/legacy/
30+
skip_existing: true
31+
# - name: Publish distribution 📦 to PyPI
32+
# if: startsWith(github.ref, 'refs/tags')
33+
# uses: pypa/gh-action-pypi-publish@release/v1
34+
# with:
35+
# password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)