Skip to content

Commit 41e8438

Browse files
authored
Merge pull request #40 from sofeikov/EZ-94-automated-pypi-package-release-on-build
Initial skeleton for publishing action
2 parents b2b9158 + ed68ebf commit 41e8438

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Upload Python Package to PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: '3.x'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install poetry==1.8.3
24+
poetry config pypi-token.pypi ${{ secrets.PYPI_PUBLISH_TOKEN }}
25+
- name: Extract version from tag
26+
id: extract_version
27+
run: |
28+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
29+
echo ${TAG_NAME}
30+
- name: Update version in pyproject.toml
31+
run: |
32+
sed -i "s/^version = .*/version = \"$TAG_NAME\"/" pyproject.toml
33+
- name: Build package
34+
run: poetry build
35+
- name: Publish package
36+
run: poetry publish

0 commit comments

Comments
 (0)