-
Notifications
You must be signed in to change notification settings - Fork 101
40 lines (38 loc) · 1.25 KB
/
deploy.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
name: Build and upload to TestPyPI and PyPI
on:
release:
types: [published]
jobs:
build-and-publish-to-pypi:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install wheel twine
python -m pip install -r requirements/requirements-3.10-Linux.txt
python -m pip install -e .
- name: Build
run: |
source env/bin/activate
python setup.py sdist bdist_wheel
ls -alh dist/
- name: Upload to TestPyPI
run: |
source env/bin/activate
python -m twine upload -r testpypi dist/* --verbose --username __token__ --password ${TESTPYPI_TOKEN}
- name: Upload to PyPI
run: |
source env/bin/activate
python -m twine upload dist/* --verbose --username __token__ --password ${PYPI_TOKEN}