Skip to content

Commit 0bcd388

Browse files
committed
Added a pypi publish job to Github Actions
1 parent fb07f60 commit 0bcd388

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ jobs:
3131
with:
3232
name: dist-${{ matrix.python-version }}
3333
path: dist/
34+
35+
pypi-publish:
36+
name: upload release to PyPI
37+
if: startsWith(github.ref, 'refs/tags/')
38+
runs-on: ubuntu-latest
39+
needs: test
40+
# Specifying a GitHub environment is optional, but strongly encouraged
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/discid
44+
permissions:
45+
# IMPORTANT: this permission is mandatory for Trusted Publishing
46+
id-token: write
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Set up Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: 3.9
53+
cache: 'pip'
54+
- name: Install dependencies
55+
run: pip install build
56+
- name: Build
57+
run: python -m build --sdist .
58+
- name: Publish package distributions to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)