|
17 | 17 | required: false
|
18 | 18 | default: "./"
|
19 | 19 | platforms:
|
20 |
| - description: Platforms to build for. |
| 20 | + description: Platforms to build for e.g. "['ubuntu-latest','macos-latest','windows-latest']" |
21 | 21 | required: false
|
22 | 22 | type: string
|
23 |
| - default: "[]" |
| 23 | + default: '' |
24 | 24 | pyversions:
|
25 |
| - description: Python versions to build for. |
| 25 | + description: Python versions to build for e.g. "['38','39','310','311','312']" |
26 | 26 | required: false
|
27 | 27 | 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 | + |
29 | 35 |
|
30 | 36 | jobs:
|
31 | 37 | deploy_source:
|
@@ -91,26 +97,26 @@ jobs:
|
91 | 97 | TWINE_USERNAME: __token__
|
92 | 98 | TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
93 | 99 | 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/* |
97 | 103 |
|
98 | 104 | - name: Build and publish to testpypi
|
99 | 105 | if: ${{ inputs.testpypi }}
|
100 | 106 | env:
|
101 | 107 | TWINE_USERNAME: __token__
|
102 | 108 | TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
|
103 | 109 | run: |
|
104 |
| - python -m build --sdist |
105 |
| - twine check dist/*.tar.gz |
| 110 | + python -m build ${{ inputs.build_args }} |
| 111 | + twine check dist/* |
106 | 112 | # HINT: if your upload fails here due to "unsupported local version",
|
107 | 113 | # put `local_scheme = "no-local-version"` pyproject.toml's
|
108 | 114 | # [tools.setuptools_scm]
|
109 |
| - twine upload --repository testpypi --verbose dist/*.tar.gz |
| 115 | + twine upload --repository testpypi --verbose dist/* |
110 | 116 |
|
111 | 117 |
|
112 | 118 | 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!='' }} |
114 | 120 | needs: deploy_source
|
115 | 121 | name: Build wheels and source distribution
|
116 | 122 | strategy:
|
|
0 commit comments