Skip to content

Commit

Permalink
add publishing to pypi (#14)
Browse files Browse the repository at this point in the history
* add publishing to pypi
  • Loading branch information
dgwhited authored Apr 25, 2023
1 parent 626ef5d commit 9c5826d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Python Package to PYPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
publish-release:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Update setup.cfg version from tag
run: |
VERSION=${{ github.event.release.tag_name }}
VERSION=${VERSION:1}
sed -i "s/version =.*/version = ${VERSION}/g" setup.cfg
- name: Install build
run: |
pip install -q build
- name: Build package
run: |
python -m build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 9c5826d

Please sign in to comment.