-
Notifications
You must be signed in to change notification settings - Fork 7
43 lines (37 loc) · 1.13 KB
/
build-and-upload.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
#
# When executed manually, this will upload to testpypi;
# when executed upon a release, it will upload to pypi.
#
# For pypi, you need to have the PYPI_USERNAME and PYPI_PASSWORD secrets configured.
# For testpypi, you'll need TESTPYPI_USERNAME and TESTPYPI_PASSWORD.
#
name: build & upload
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
build-wheel:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: build it
run: |
python3 -m pip install build wheel twine virtualenv
python3 -m build --wheel
- name: Non-release (dev) upload
if: github.event_name != 'release'
env:
TWINE_REPOSITORY: testpypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
run: twine upload --verbose dist/*
- name: Release upload
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload --verbose dist/*