From 9f9f5dc990915fa15e40775c29b749b6bf6e8a1d Mon Sep 17 00:00:00 2001 From: Jesper Dramsch Date: Mon, 16 Dec 2024 14:13:24 +0000 Subject: [PATCH 1/2] add working directory to CD pypi --- .github/workflows/cd-pypi.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cd-pypi.yml b/.github/workflows/cd-pypi.yml index 1126edc..fcaf16c 100644 --- a/.github/workflows/cd-pypi.yml +++ b/.github/workflows/cd-pypi.yml @@ -10,6 +10,12 @@ on: type: boolean required: false default: false + work-directory: + description: Working directory to build Python package (for monorepos). + Defaults to root directory. + type: string + required: false + default: "/" jobs: deploy: @@ -65,6 +71,7 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | + cd ${{ inputs.working_directory }} python -m build twine upload dist/* @@ -74,5 +81,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }} run: | + cd ${{ inputs.working_directory }} python -m build twine upload --repository testpypi dist/* From 0f9936e9ad858592770ade076999c74e11af601a Mon Sep 17 00:00:00 2001 From: Jesper Dramsch Date: Fri, 10 Jan 2025 14:52:19 +0000 Subject: [PATCH 2/2] fix: corrections form Iain --- .github/workflows/cd-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-pypi.yml b/.github/workflows/cd-pypi.yml index fcaf16c..a79fb8c 100644 --- a/.github/workflows/cd-pypi.yml +++ b/.github/workflows/cd-pypi.yml @@ -15,7 +15,7 @@ on: Defaults to root directory. type: string required: false - default: "/" + default: "./" jobs: deploy: @@ -71,7 +71,7 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - cd ${{ inputs.working_directory }} + cd ${{ inputs.working-directory }} python -m build twine upload dist/* @@ -81,6 +81,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }} run: | - cd ${{ inputs.working_directory }} + cd ${{ inputs.working-directory }} python -m build twine upload --repository testpypi dist/*