Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
name: Publish to TestPyPI and PyPI
name: Publish to PyPI

on:
# Triggers the workflow when a release is created or edited.
release:
types: [created]

jobs:
build-n-publish:
name: Publish to TestPyPI and PyPI
build:
name: Build distribution
runs-on: ubuntu-latest
permissions:
id-token: write # For pypi trusted publishing

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install pypa/build
run: python -m pip install build --user

run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
repository-url: https://test.pypi.org/legacy/
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
publish-to-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/paramax

permissions:
id-token: write # Mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1