Skip to content

Publish to PyPI and Github Release #5

Publish to PyPI and Github Release

Publish to PyPI and Github Release #5

name: Publish to PyPI and Github Release
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Setup Build Env
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 14.15.3
nvm use 14.15.3
npm install --global yarn
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build Extension in Dev Mode
run: |
pip install -e .
- name: Build Wheel
run: |
python -m pip install --upgrade build &&
python -m build
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: xircuits-wheel
path: dist
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
run: |
pip install twine
twine upload dist/*
- name: Publish to GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}