Skip to content

Commit

Permalink
Add publishing workflow (#4)
Browse files Browse the repository at this point in the history
* Bump version and project status

* Add publish-release workflow
  • Loading branch information
skeletorXVI authored Dec 10, 2024
1 parent 16d2978 commit 48ab74f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 4 deletions.
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

0 comments on commit 48ab74f

Please sign in to comment.