Skip to content

Commit edb0cd1

Browse files
publish python package
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
1 parent d54c94d commit edb0cd1

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: "Build Packages"
22

3-
"on": push
3+
"on":
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
publish:
9+
description: "Publish packages"
10+
required: true
11+
default: "false"
412

513
jobs:
614
build-manylinux:
@@ -155,3 +163,14 @@ jobs:
155163
with:
156164
name: python-${{ runner.os }}
157165
path: wrappers/python/dist/*
166+
167+
- if: |
168+
(github.event_name == 'release' ||
169+
(github.event_name == 'workflow_dispatch' &&
170+
github.event.inputs.publish == 'true'))
171+
name: Publish python package
172+
env:
173+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
174+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
175+
run: |
176+
twine upload --skip-existing wrappers/python/dist/*

0 commit comments

Comments
 (0)