Skip to content

Commit b0c26b4

Browse files
committed
Switch the "publish" step to the CI workflow
1 parent 4ac8e4e commit b0c26b4

File tree

4 files changed

+30
-54
lines changed

4 files changed

+30
-54
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
coverage:
9999
name: Coverage
100100
runs-on: ubuntu-latest
101-
needs: build
101+
needs: [build]
102102
steps:
103103
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
104104

@@ -118,3 +118,25 @@ jobs:
118118
with:
119119
name: python-coverage-comment-action
120120
path: python-coverage-comment-action.txt
121+
122+
publish:
123+
name: Publish package to PyPI
124+
if: github.event_name == 'push' && github.ref_type == 'tag'
125+
runs-on: ubuntu-latest
126+
environment: release
127+
permissions:
128+
id-token: write
129+
needs:
130+
- build
131+
- static-typing
132+
steps:
133+
- name: Install poetry
134+
run: |
135+
pipx install poetry
136+
pipx inject poetry 'poetry-dynamic-versioning[plugin]'
137+
138+
- name: Publish on PyPI
139+
run: poetry build
140+
141+
- name: Publish package distributions to PyPI
142+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/publish.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[build-system]
2+
requires = ["poetry-core", "poetry-dynamic-versioning"]
3+
build-backend = "poetry_dynamic_versioning.backend"
14

25
[tool.poetry]
36
name = "procrastinate"
@@ -35,7 +38,6 @@ python-dateutil = "*"
3538
sqlalchemy = { version = "^2.0", optional = true }
3639
typing-extensions = { version = "*", python = "<3.8" }
3740

38-
3941
[tool.poetry.extras]
4042
django = ["django"]
4143
sqlalchemy = ["sqlalchemy"]
@@ -79,6 +81,10 @@ sphinx-copybutton = "*"
7981
sphinx-github-changelog = "*"
8082
sphinxcontrib-programoutput = "*"
8183

84+
[tool.poetry-dynamic-versioning]
85+
enable = true
86+
pattern = '(?P<base>\d+(\.\d+)*)([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\d+)?))?$'
87+
8288
[tool.pytest.ini_options]
8389
addopts = [
8490
"--cov-report=term-missing",
@@ -134,7 +140,3 @@ required-imports = ["from __future__ import annotations"]
134140
[tool.doc8]
135141
max-line-length = 88
136142
ignore-path = "docs/_build,.venv"
137-
138-
[build-system]
139-
requires = ["poetry-core>=1.0.0"]
140-
build-backend = "poetry.core.masonry.api"

scripts/publish

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)