Skip to content

Commit

Permalink
[IN-1356] Add workflow to publish to pypi (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
travertischio authored Nov 8, 2023
1 parent 1887bfe commit eeba257
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish package

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9a-zA-Z]+' # Matches 1.2.3, 1.2.3alpha1 etc.

jobs:
publish-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 pip dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
run: |
python setup.py sdist bdist_wheel
twine upload --non-interactive dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

publish-github-release:
name: Create Release
runs-on: ubuntu-latest
needs: [publish-pypi]
steps:
- uses: actions/checkout@v4
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit eeba257

Please sign in to comment.