-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
48 lines (46 loc) · 1.36 KB
/
action.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
name: 'Build and push Python package'
description: 'Composite action to build and push a Python package to a repository.'
inputs:
repository:
description: "Name of the Python repository"
required: true
default: pypi
username:
description: "Username for the Python repository"
required: true
default: __token__
password:
description: "Password for the Python repository"
required: true
upload:
description: "Whether or not to upload the package"
required: true
default: true
sdist:
description: "Whether or not to build the source distribution"
required: true
default: true
wheel:
description: "Whether or not to build the wheel"
required: true
default: true
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
- run: python -m pip install build twine
shell: bash
# See https://github.com/actions/runner/issues/1483
- run: python -m build --sdist
shell: bash
if: ${{ inputs.sdist == 'true' }}
- run: python -m build --wheel
shell: bash
if: ${{ inputs.wheel == 'true' }}
- run: python -m twine upload --skip-existing dist/*
shell: bash
if: ${{ inputs.upload == 'true' }}
env:
TWINE_REPOSITORY: ${{ inputs.repository }}
TWINE_USERNAME: ${{ inputs.username }}
TWINE_PASSWORD: ${{ inputs.password }}