Skip to content

Commit

Permalink
ci: added release CI (uploads to PyPi)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 9, 2023
1 parent 62c4ac4 commit fa46b80
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
release:
types: [created]

jobs:
publish-pypi:
name: Publish to PyPi
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
# set pyproject.toml version to github.ref_name (without v prefix)
# just in case someone forgot...
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
sed -i 's/^version = ".*"$/version = "'"$VERSION"'"/' pyproject.toml
poetry publish --build --username=__token__ --password=$PYPI_TOKEN

0 comments on commit fa46b80

Please sign in to comment.