Skip to content

Commit

Permalink
Merge pull request #40 from sofeikov/EZ-94-automated-pypi-package-rel…
Browse files Browse the repository at this point in the history
…ease-on-build

Initial skeleton for publishing action
  • Loading branch information
sofeikov authored Jun 30, 2024
2 parents b2b9158 + ed68ebf commit 41e8438
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Upload Python Package to PyPi

on:
release:
types: [published]


permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.8.3
poetry config pypi-token.pypi ${{ secrets.PYPI_PUBLISH_TOKEN }}
- name: Extract version from tag
id: extract_version
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo ${TAG_NAME}
- name: Update version in pyproject.toml
run: |
sed -i "s/^version = .*/version = \"$TAG_NAME\"/" pyproject.toml
- name: Build package
run: poetry build
- name: Publish package
run: poetry publish

0 comments on commit 41e8438

Please sign in to comment.