Skip to content

Commit a6547ca

Browse files
committed
Added workflow for automating publishing
1 parent 0c729ec commit a6547ca

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
name: Publish to PyPI
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/${{ github.event.repository.name }}
14+
permissions:
15+
id-token: write # Required for trusted publishing
16+
contents: read # Required to checkout the repository
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install poetry
31+
poetry config virtualenvs.in-project true
32+
poetry install
33+
34+
- name: Build package
35+
run: poetry build
36+
37+
- name: Publish to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
print-hash: true

0 commit comments

Comments
 (0)