Skip to content

Commit 05de58b

Browse files
Pedro RodriguesPedro Rodrigues
authored andcommitted
publish package on pypi on push
1 parent 3fca730 commit 05de58b

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Python Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- ci/update-package-version-on-github-action # TODO: Remove this branch after testing
8+
workflow_dispatch: # Allows manual triggering
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
environment: release
14+
permissions:
15+
id-token: write # OIDC authentication with PyPI
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
pip install -r requirements.txt
30+
31+
- name: Build package
32+
run: python -m build
33+
34+
- name: Publish package to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
password: ${{ secrets.PYPI_API_KEY }}

0 commit comments

Comments
 (0)