Skip to content

Commit b587d25

Browse files
authored
PyPi publishing (#36)
This changes the release job so that, it updates the package on PyPI: https://pypi.org/project/rsnapshot-docker-compose-backup/
1 parent 3acd11f commit b587d25

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,40 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: "3.9"
20-
- name: Install pypa/build
21-
run: python3 -m pip install build --user
16+
- name: Install Hatch
17+
uses: pypa/hatch@install
2218
- name: Build a binary wheel and a source tarball
23-
run: python3 -m build
19+
run: hatch build
2420
- name: Store the distribution packages
2521
uses: actions/upload-artifact@v4
2622
with:
2723
name: python-package-distributions
2824
path: dist/
25+
publish-to-pypi:
26+
name: >-
27+
Publish Python 🐍 distribution 📦 to PyPI
28+
needs:
29+
- build
30+
runs-on: ubuntu-latest
31+
environment:
32+
name: pypi
33+
url: https://pypi.org/p/rsnapshot-docker-compose-backup
34+
permissions:
35+
id-token: write # IMPORTANT: mandatory for trusted publishing
36+
steps:
37+
- name: Download all the dists
38+
uses: actions/download-artifact@v3
39+
with:
40+
name: python-package-distributions
41+
path: dist/
42+
- name: Publish distribution 📦 to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1
2944
github-release:
3045
name: >-
3146
Sign the Python 🐍 distribution 📦 with Sigstore
3247
and upload them to GitHub Release
3348
needs:
34-
- build
49+
- publish-to-pypi
3550
runs-on: ubuntu-latest
3651
permissions:
3752
contents: write # IMPORTANT: mandatory for making GitHub Releases

0 commit comments

Comments
 (0)