ref: Require github release to publish to pypi
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled

This commit is contained in:
Marty Oehme 2025-04-10 09:27:10 +02:00
parent f546076259
commit 4ecf3627d3
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -27,48 +27,6 @@ jobs:
name: python-package-distributions name: python-package-distributions
path: dist/ path: dist/
publish-to-testpypi:
name: Test publishing to testpypi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
environment:
name: testpypi
url: https://test.pypi.org/p/topen
permissions:
id-token: write
steps:
- name: Grab dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Send off to TestPyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish dist to pypi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/topen
permissions:
id-token: write
steps:
- name: Grab dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Send off to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
create-release: create-release:
name: Create github release name: Create github release
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -93,3 +51,46 @@ jobs:
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: dist/* files: dist/*
publish-to-testpypi:
name: Test publishing to testpypi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- create-release # use github release as sanity check for releases
environment:
name: testpypi
url: https://test.pypi.org/p/topen
permissions:
id-token: write
steps:
- name: Grab dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Send off to TestPyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish dist to pypi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- create-release
environment:
name: pypi
url: https://pypi.org/p/topen
permissions:
id-token: write
steps:
- name: Grab dist files
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Send off to PyPi
uses: pypa/gh-action-pypi-publish@release/v1