From 2024d1cd76fd0847a18d45f2f835750cf832f978 Mon Sep 17 00:00:00 2001 From: Dusan Baran Date: Tue, 23 Jul 2024 15:43:54 +0200 Subject: [PATCH 1/2] Set version in workflow dispatch --- .github/workflows/build-wheels.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 6f9ac9f6d4..f65990ceaa 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -2,15 +2,17 @@ name: Build and test wheels on: workflow_dispatch: + inputs: + version: + description: Version to use are release version + required: true + type: string push: - branches: - - release-* - - "*wheel*" # must quote since "*" is a YAML reserved character; we want a string tags: - "*" - pull_request: - branches: - - "*wheel*" # must quote since "*" is a YAML reserved character; we want a string + +env: + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TILEDB: ${{ inputs.version }} jobs: build_wheels: @@ -142,5 +144,6 @@ jobs: repository-url: https://test.pypi.org/legacy/ - name: Upload to pypi + # If we tagged a version release it on PyPI if: startsWith(github.ref, 'refs/tags/') uses: pypa/gh-action-pypi-publish@release/v1 From 4a0616913bb53b4bf8b45f6326debf1435fad6a1 Mon Sep 17 00:00:00 2001 From: Dusan Baran Date: Wed, 24 Jul 2024 13:08:34 +0200 Subject: [PATCH 2/2] Add option to not upload to test.pypi.org --- .github/workflows/build-wheels.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index f65990ceaa..5c9dd1df38 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -7,6 +7,11 @@ on: description: Version to use are release version required: true type: string + test_pypi: + description: Upload packages to test.pypi.org + required: false + type: boolean + default: false push: tags: - "*" @@ -139,11 +144,12 @@ jobs: echo "package_version=$(ls dist/ | head -n 1 | cut -d - -f 2)" >> "$GITHUB_OUTPUT" - name: Upload to test-pypi + if: inputs.test_pypi uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - name: Upload to pypi # If we tagged a version release it on PyPI - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && inputs.version == '' uses: pypa/gh-action-pypi-publish@release/v1