Skip to content

Commit

Permalink
Add Github action for auto publish to pypi (#62)
Browse files Browse the repository at this point in the history
* Closes #45 
* Adds Github Action to build wheels and publish to PyPI
  • Loading branch information
ColdHeat committed Jun 22, 2021
1 parent 3f6c662 commit 7176dd5
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build wheels

on:
release:
types: [created, edited]
pull_request:
types: [opened, reopened, edited, synchronize]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Set up Python environment
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r development.txt
# Build wheels
- name: Build wheels
run: python setup.py sdist bdist_wheel

- uses: actions/upload-artifact@v2
with:
path: |
./dist/*.tar.gz
# Publish to pypi
- name: Publish to pypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: ${{ github.event_name == 'release' && env.TWINE_USERNAME != null }}
run: twine upload --repository pypi dist/*

0 comments on commit 7176dd5

Please sign in to comment.