Skip to content

Commit 527e75d

Browse files
authored
Add workflows to publish to PyPI and GH Pages (#4)
* Add workflow to publish to PyPI * Add workflow to publish docs to GitHub pages * Upgrade mkdocs * Bump version
1 parent cf03c23 commit 527e75d

File tree

4 files changed

+115
-9
lines changed

4 files changed

+115
-9
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish documentation website to GitHub pages
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: .cache
28+
restore-keys: |
29+
mkdocs-material-
30+
- run: pip install mkdocs-material mkdocstrings[python]
31+
- run: mkdocs gh-deploy --force

.github/workflows/publish-to-pypi.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish releases to PyPI and publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
- name: Install pypa/build
20+
run: >-
21+
python3 -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: python-package-distributions
31+
path: dist/
32+
33+
publish-to-pypi:
34+
name: >-
35+
Publish to PyPI
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/xml2db
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v3
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
publish-to-testpypi:
55+
name: Publish to TestPyPI
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testpypi
62+
url: https://test.pypi.org/p/xml2db
63+
64+
permissions:
65+
id-token: write
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v3
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "xml2db"
7-
version = "0.9.4"
7+
version = "0.10.0"
88
authors = [
99
{ name="Commission de régulation de l'énergie", email="[email protected]" },
1010
]
@@ -23,7 +23,7 @@ dependencies = [
2323
]
2424

2525
[project.optional-dependencies]
26-
docs = ["mkdocs-material==9.5.14", "mkdocstrings[python]==0.24.1"]
26+
docs = ["mkdocs-material==9.5.23", "mkdocstrings-python==1.10.2"]
2727
tests = ["pytest>=7.0"]
2828

2929
[project.urls]

requirements.txt

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ elementpath==4.4.0
77
exceptiongroup==1.2.0
88
ghp-import==2.1.0
99
greenlet==3.0.3
10-
griffe==0.42.1
10+
griffe==0.45.0
1111
idna==3.6
1212
iniconfig==2.0.0
1313
Jinja2==3.1.3
1414
lxml==5.1.0
1515
Markdown==3.5.2
1616
MarkupSafe==2.1.5
1717
mergedeep==1.3.4
18-
mkdocs==1.5.3
18+
mkdocs==1.6.0
1919
mkdocs-autorefs==1.0.1
20-
mkdocs-material==9.5.14
20+
mkdocs-get-deps==0.2.0
21+
mkdocs-material==9.5.23
2122
mkdocs-material-extensions==1.3.1
22-
mkdocstrings==0.24.1
23-
mkdocstrings-python==1.9.0
23+
mkdocstrings==0.25.1
24+
mkdocstrings-python==1.10.2
2425
packaging==24.0
2526
paginate==0.5.6
2627
pathspec==0.12.1
@@ -42,6 +43,4 @@ tomli==2.0.1
4243
typing_extensions==4.10.0
4344
urllib3==2.2.1
4445
watchdog==4.0.0
45-
# Editable Git install with no remote (xml2db==0.9.4)
46-
-e d:\code\xml2db-os
4746
xmlschema==3.1.0

0 commit comments

Comments
 (0)