Spaces:
Running
Running
Commit
·
2bd75b6
1
Parent(s):
df21dce
Create PyPI deployment job
Browse files
.github/workflows/pypi_deploy.yml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Deploy PyPI
|
| 2 |
+
on:
|
| 3 |
+
workflow_run:
|
| 4 |
+
workflows: ["Linux", "macOS", "Windows"]
|
| 5 |
+
types:
|
| 6 |
+
- completed
|
| 7 |
+
# Also, run on new versions:
|
| 8 |
+
push:
|
| 9 |
+
branches:
|
| 10 |
+
- "**"
|
| 11 |
+
tags:
|
| 12 |
+
- "v*.*.*"
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
jobs:
|
| 16 |
+
pypi:
|
| 17 |
+
runs-on: ubuntu-latest
|
| 18 |
+
steps:
|
| 19 |
+
- name: "Checkout"
|
| 20 |
+
uses: actions/checkout@v3
|
| 21 |
+
- name: "Set up Python"
|
| 22 |
+
uses: actions/setup-python@v4
|
| 23 |
+
with:
|
| 24 |
+
python-version: 3.10.8
|
| 25 |
+
- name: "Install building tools"
|
| 26 |
+
run: pip install wheel
|
| 27 |
+
- name: "Build package"
|
| 28 |
+
run: python setup.py sdists bdist_wheel
|
| 29 |
+
- name: "Publish distribution 📦 to Test PyPI"
|
| 30 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 31 |
+
with:
|
| 32 |
+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
| 33 |
+
repository_url: https://test.pypi.org/legacy/
|
| 34 |
+
- name: "Publish distribution 📦 to PyPI"
|
| 35 |
+
if: startsWith(github.ref, 'refs/tags')
|
| 36 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
| 37 |
+
with:
|
| 38 |
+
password: ${{ secrets.PYPI_API_TOKEN }}
|