Skip to content

(Version): bump to v0.6.9 (fixing tags) #4

(Version): bump to v0.6.9 (fixing tags)

(Version): bump to v0.6.9 (fixing tags) #4

name: Publish Python 🐍 source distribution 📦 to PyPI and TestPyPI
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build-sdist:
name: Build source distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build (build frontend)
run: python3 -m pip install build --user
- name: Build the source distribution
run: python3 -m build --sdist
- name: Store the source distribution package
uses: actions/upload-artifact@v3
with:
name: python-package-source-distribution
path: dist/
publish-to-testpypi:
name: Publish Python 🐍 source distribution 📦 to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to TestPyPI on tag pushes
needs:
- build-sdist
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/wp-math3d
permissions:
id-token: write
steps:
- name: Download the source distribution
uses: actions/download-artifact@v3
with:
name: python-package-source-distribution
path: dist/
- name: Publish source distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish Python 🐍 source distribution 📦 to PyPI
if: startsWIth(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build-sdist
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/wp-math3d
permissions:
id-token: write
steps:
- name: Download the source distribution
uses: actions/download-artifact@v3
with:
name: python-package-source-distribution
path: dist/
- name: Publish source distribution to 📦 PyPI
uses: pypa/gh-action-pypi-publish@release/v1