From 4c8fd7a12a0044a4ad278f58b3cb0c5701267611 Mon Sep 17 00:00:00 2001 From: Xiaocheng Dong Date: Sun, 7 Apr 2024 01:41:49 -0400 Subject: [PATCH] workflow: add workflow to publish pypi packages Signed-off-by: Xiaocheng Dong --- .github/workflows/publish-pypi-packages.yaml | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/publish-pypi-packages.yaml diff --git a/.github/workflows/publish-pypi-packages.yaml b/.github/workflows/publish-pypi-packages.yaml new file mode 100644 index 0000000..1ffc53c --- /dev/null +++ b/.github/workflows/publish-pypi-packages.yaml @@ -0,0 +1,27 @@ +name: Publish the package to PyPI + +on: + workflow_dispatch: + + +jobs: + publish_pypi: + name: Publish package + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Checkout action repository + uses: actions/checkout@v3 + + - name: Publish package + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m pip install --upgrade twine build + pushd src/python/ + python3 -m build + python3 -m twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD --repository pypi dist/* + popd