Skip to content

Commit 8842821

Browse files
committed
pypi: Automatic release
pyproject.toml is necessary to ensure the build has docutils.
1 parent 027e789 commit 8842821

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/pypi.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Upload release to PyPI (Test & Live)
2+
on:
3+
push:
4+
branches: [main]
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI (Test & Live)
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/sphinxcontrib-opendataservices-jsonschema
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.12'
22+
- run: pip install --upgrade build
23+
- run: python -m build --sdist --wheel
24+
- name: Publish package distributions to TEST PyPI
25+
if: github.event_name == 'push'
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
repository-url: https://test.pypi.org/legacy/
29+
skip-existing: true
30+
- name: Publish package distributions to LIVE PyPI
31+
if: github.event_name == 'release'
32+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "docutils"]
3+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)