-
Notifications
You must be signed in to change notification settings - Fork 24
34 lines (27 loc) · 1005 Bytes
/
pypi.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
name: Publish to PyPI
on:
workflow_run:
workflows: ["Unit Tests"] # The name of the tests workflow
types:
- completed # This will trigger the workflow when the tests workflow completes
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only run if tests passed
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # Specify the Python version you want to use
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build the package
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__ # Use the username __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} # Ensure you have this secret set up
run: twine upload dist/*