From edb0cd1e6c392f724903966b0e997adfeb200a77 Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Thu, 18 Feb 2021 15:11:08 -0800 Subject: [PATCH] publish python package Signed-off-by: Andrew Whitehead --- .github/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626ae89..68ce6ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,14 @@ name: "Build Packages" -"on": push +"on": + release: + types: [created] + workflow_dispatch: + inputs: + publish: + description: "Publish packages" + required: true + default: "false" jobs: build-manylinux: @@ -155,3 +163,14 @@ jobs: with: name: python-${{ runner.os }} path: wrappers/python/dist/* + + - if: | + (github.event_name == 'release' || + (github.event_name == 'workflow_dispatch' && + github.event.inputs.publish == 'true')) + name: Publish python package + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload --skip-existing wrappers/python/dist/*