Skip to content

Commit 648c34e

Browse files
committed
Add GitHub Actions workflow for PyPI publishing
The workflow carries out the following steps: 1. Check out the repository. 2. Install Python. 3. Install Poetry (with the required plugins). 4. Build the package. 5. Publish the package to pypi. The publishing process does not require the use of any credentials or keys as it utilizes Pypi's "Trusted Publishing" support. See also: https://docs.pypi.org/trusted-publishers/.
1 parent ded2dca commit 648c34e

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Continuous Delivery
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/mbdata
13+
permissions:
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
- uses: snok/install-poetry@v1
21+
with:
22+
plugins: |
23+
poetry-dynamic-versioning[plugin]
24+
- run: poetry build
25+
- uses: pypa/gh-action-pypi-publish@release/v1

DEVELOPMENT.rst

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ Release a new version
2828

2929
1. Add notes to ``CHANGELOG.rst``
3030

31-
2. Tag the repository::
31+
2. Create a new Github release.
3232

33-
git tag -s vX.Y.Z
34-
35-
3. Build the package::
36-
37-
poetry build
38-
39-
4. Upload the package to PyPI::
40-
41-
rm -rf dist/
42-
python setup.py sdist
43-
twine upload dist/mbdata-*.tar.gz
33+
3. The publish workflow will build a new package distribution and upload it to pypi.

0 commit comments

Comments
 (0)