Always upload to testing, only upload to real pypi on a tagged release
This commit is contained in:
parent
760692e496
commit
1e8211c973
|
@ -77,27 +77,68 @@ jobs:
|
||||||
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
|
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
|
||||||
path: ./wheelhouse/*.whl
|
path: ./wheelhouse/*.whl
|
||||||
|
|
||||||
|
test_upload_pypi:
|
||||||
|
# TODO: create an sdist that can build without a custom environment
|
||||||
|
needs: [build_wheels]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
buildplat:
|
||||||
|
- [ubuntu-20.04, manylinux_x86_64]
|
||||||
|
#- [ubuntu-20.04, musllinux_x86_64]
|
||||||
|
#- [macos-12, macosx_x86_64]
|
||||||
|
#- [windows-2019, win_amd64]
|
||||||
|
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
|
||||||
|
exclude:
|
||||||
|
# Don't build PyPy 32-bit windows
|
||||||
|
- buildplat: [windows-2019, win32]
|
||||||
|
python: "pp39"
|
||||||
|
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
|
||||||
|
python: "pp39"
|
||||||
|
|
||||||
|
environment: pypi
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
- uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 #v1.8.8
|
||||||
|
with:
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
||||||
|
|
||||||
upload_pypi:
|
upload_pypi:
|
||||||
# TODO: create an sdist that can build without a custom environment
|
# TODO: create an sdist that can build without a custom environment
|
||||||
needs: [build_wheels]
|
needs: [build_wheels]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
buildplat:
|
||||||
|
- [ubuntu-20.04, manylinux_x86_64]
|
||||||
|
#- [ubuntu-20.04, musllinux_x86_64]
|
||||||
|
#- [macos-12, macosx_x86_64]
|
||||||
|
#- [windows-2019, win_amd64]
|
||||||
|
python: ["cp39", "cp310", "cp311", "cp312"] # "pp39"
|
||||||
|
exclude:
|
||||||
|
# Don't build PyPy 32-bit windows
|
||||||
|
- buildplat: [windows-2019, win32]
|
||||||
|
python: "pp39"
|
||||||
|
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
|
||||||
|
python: "pp39"
|
||||||
|
|
||||||
environment: pypi
|
environment: pypi
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
#if: github.event_name == 'release' && github.event.action == 'published'
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
# unpacks default artifact into dist/
|
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
|
||||||
# if `name: artifact` is omitted, the action will create extra parent dir
|
|
||||||
name: artifact
|
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
|
||||||
# Testing for now
|
|
||||||
repository_url: https://test.pypi.org/legacy/
|
|
||||||
#
|
#
|
||||||
# build_sdist:
|
# build_sdist:
|
||||||
# name: Build sdist
|
# name: Build sdist
|
||||||
|
|
Loading…
Reference in New Issue