Skip to content

Commit 06ab1ab

Browse files
committed
bugfix strategy
1 parent 8a5bfe5 commit 06ab1ab

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/cd-pypi.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ on:
1717
required: false
1818
default: "./"
1919
platforms:
20-
description: Platforms to build for.
20+
description: Platforms to build for e.g. "['ubuntu-latest','macos-latest','windows-latest']"
2121
required: false
2222
type: string
23-
default: "[]"
23+
default: ''
2424
pyversions:
25-
description: Python versions to build for.
25+
description: Python versions to build for e.g. "['38','39','310','311','312']"
2626
required: false
2727
type: string
28-
default: "[]"
28+
default: ''
29+
build_args:
30+
description: Args to pass in to build as `python -m build {build_args}` e.g. '--sdist'
31+
type: string
32+
required: false
33+
default: ''
34+
2935

3036
jobs:
3137
deploy_source:
@@ -91,26 +97,26 @@ jobs:
9197
TWINE_USERNAME: __token__
9298
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
9399
run: |
94-
python -m build --sdist
95-
twine check dist/*.tar.gz
96-
twine upload dist/*.tar.gz
100+
python -m build ${{ inputs.build_args }}
101+
twine check dist/*
102+
twine upload dist/*
97103
98104
- name: Build and publish to testpypi
99105
if: ${{ inputs.testpypi }}
100106
env:
101107
TWINE_USERNAME: __token__
102108
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
103109
run: |
104-
python -m build --sdist
105-
twine check dist/*.tar.gz
110+
python -m build ${{ inputs.build_args }}
111+
twine check dist/*
106112
# HINT: if your upload fails here due to "unsupported local version",
107113
# put `local_scheme = "no-local-version"` pyproject.toml's
108114
# [tools.setuptools_scm]
109-
twine upload --repository testpypi --verbose dist/*.tar.gz
115+
twine upload --repository testpypi --verbose dist/*
110116
111117
112118
deploy_wheels:
113-
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' || inputs.testpypi }}
119+
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' || inputs.testpypi || inputs.platforms!='' || inputs.pyversions!='' }}
114120
needs: deploy_source
115121
name: Build wheels and source distribution
116122
strategy:

0 commit comments

Comments
 (0)