-
Notifications
You must be signed in to change notification settings - Fork 23
43 lines (40 loc) · 1.36 KB
/
Copy pathpython-package.yml
File metadata and controls
43 lines (40 loc) · 1.36 KB
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
35
36
37
38
39
40
41
42
43
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
workflow_call:
inputs:
use_testpypi:
required: true
type: boolean
jobs:
upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
pip install -r requirements_minimal.txt;
- name: Upload to TestPyPI
if: ${{ inputs.use_testpypi }}
run: |
python3 setup.py sdist bdist_wheel --build-number $GITHUB_RUN_NUMBER
python3 -m twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
TWINE_REPOSITORY: testpypi
- name: Upload to PyPI
if: ${{ !inputs.use_testpypi }}
run: |
python3 setup.py sdist bdist_wheel --build-number $GITHUB_RUN_NUMBER
python3 -m twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}