Skip to content

Add publishing workflow #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
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
74 changes: 74 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish package to PyPI

on:
release:
types: [published]

jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.12"

- name: Install poetry
run: |
python -m pip install poetry==1.8.2

- name: Build package
run: |
python -m poetry build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-github-release:
name: Sign the distribution packages and publish to GitHub Releases
needs:
- build
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl

publish-to-pypi:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/pytest-parametrization-annotation
permissions:
id-token: write # IMPORTANT: 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
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tool.poetry]
name = "pytest-parametrization-annotation"
version = "0.1.0"
version = "1.0.0"
description = "A pytest library for parametrizing tests using type hints."
authors = ["Fabian Haenel <contact@fabian-haenel.io>"]
readme = "README.md"
packages = [{include = "pytest_parametrization_annotation", from = "src"}]
classifiers = [
# Status
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",

# License
"License :: OSI Approved :: BSD License",
Expand All @@ -33,12 +33,10 @@ classifiers = [
[tool.poetry.plugins."pytest11"]
pytest-parametrization-annotation = "pytest_parametrization_annotation.plugin"


[tool.poetry.dependencies]
python = ">=3.10"
pytest = ">=7"


[tool.poetry.group.linting.dependencies]
ruff = "v0.8.2"
black = "v24.10"
Expand Down
Loading