-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (40 loc) · 1.23 KB
/
python-publish.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
name: Upload Python package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
id: python
uses: actions/setup-python@v4.2.0
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv setuptools wheel twine
pipenv sync
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Check Build
run: |
twine check dist/*
- name: Publish to Test PYPI
if: github.event_name == 'release' || startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PYPI 📦
if: github.event_name == 'release' || startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}