Skip to content

Commit 48ab74f

Browse files
authored
Add publishing workflow (#4)
* Bump version and project status * Add publish-release workflow
1 parent 16d2978 commit 48ab74f

File tree

2 files changed

+76
-4
lines changed

2 files changed

+76
-4
lines changed

.github/workflows/publish-release.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Publish package to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build package
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
id: setup-python
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Install poetry
21+
run: |
22+
python -m pip install poetry==1.8.2
23+
24+
- name: Build package
25+
run: |
26+
python -m poetry build
27+
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
publish-to-github-release:
35+
name: Sign the distribution packages and publish to GitHub Releases
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
40+
permissions:
41+
contents: write # IMPORTANT: mandatory for making GitHub Releases
42+
id-token: write # IMPORTANT: mandatory for sigstore
43+
44+
steps:
45+
- name: Download all the dists
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
- name: Sign the dists with Sigstore
51+
uses: sigstore/gh-action-sigstore-python@v3.0.0
52+
with:
53+
inputs: >-
54+
./dist/*.tar.gz
55+
./dist/*.whl
56+
57+
publish-to-pypi:
58+
name: Publish package to PyPI
59+
runs-on: ubuntu-latest
60+
needs:
61+
- build
62+
environment:
63+
name: pypi
64+
url: https://pypi.org/p/pytest-parametrization-annotation
65+
permissions:
66+
id-token: write # IMPORTANT: mandatory for trusted publishing
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[tool.poetry]
22
name = "pytest-parametrization-annotation"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
description = "A pytest library for parametrizing tests using type hints."
55
authors = ["Fabian Haenel <contact@fabian-haenel.io>"]
66
readme = "README.md"
77
packages = [{include = "pytest_parametrization_annotation", from = "src"}]
88
classifiers = [
99
# Status
10-
"Development Status :: 4 - Beta",
10+
"Development Status :: 5 - Production/Stable",
1111

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

36-
3736
[tool.poetry.dependencies]
3837
python = ">=3.10"
3938
pytest = ">=7"
4039

41-
4240
[tool.poetry.group.linting.dependencies]
4341
ruff = "v0.8.2"
4442
black = "v24.10"

0 commit comments

Comments
 (0)