Skip to content

Commit

Permalink
Added deploy to PyPI Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanz committed Jun 4, 2021
1 parent e8a158b commit f56184a
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Deploy to PyPI

on:
release:
types: [ created ]

jobs:
macos:
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
default: true
- name: Build wheels - x86_64
uses: messense/maturin-action@v1
with:
maturin-version: latest
target: x86_64
args: --release --out dist
- name: Build wheels - universal2
uses: messense/maturin-action@v1
with:
args: --release --universal2 --out dist --no-sdist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
default: true
- name: Build wheels
uses: messense/maturin-action@v1
with:
maturin-version: latest
target: ${{ matrix.target }}
args: --release --out dist --no-sdist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
default: true
- name: Build Wheels
uses: messense/maturin-action@v1
with:
maturin-version: latest
target: ${{ matrix.target }}
args: --release --out dist --no-sdist
container: off
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ macos, windows, linux]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *

0 comments on commit f56184a

Please sign in to comment.