Skip to content

0.1.0

0.1.0 #38

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- main
paths-ignore:
- README.md
permissions:
contents: read
jobs:
windows-validation:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
runs-on: windows-latest
if: github.event_name == 'pull_request' || github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install cython==3.0.4 --config-setting no_cython_compile=True --no-cache-dir
pip install setuptools
- name: Compile Cython extensions
run: |
cython nazo_rand/nazo_rand.pyx
python setup.py build_ext --inplace
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 9
submodules: false
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install cython==3.0.4 --config-setting no_cython_compile=True --no-cache-dir
pip install setuptools
- name: Compile Cython extensions
run: |
python3 setup.py build_ext --inplace
build-wheels:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 9
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
pip install cython==3.0.4 --config-setting no_cython_compile=True --no-cache-dir
python -m pip install --upgrade setuptools pip wheel build
- name: Compile Cython extensions
run: |
cython nazo_rand/nazo_rand.pyx
- name: Add execute permission to build script
run: chmod +x ${{ github.workspace }}/.github/workflows/build-manylinux-wheels.sh
- name: Build wheels (linux)
if: startsWith(matrix.os, 'ubuntu')
uses: docker://quay.io/pypa/manylinux2014_x86_64
env:
PYTHON_VERSION: ${{ matrix.python-version }}
with:
entrypoint: /github/workspace/.github/workflows/build-manylinux-wheels.sh
- name: Build wheels (non-linux)
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
run: |
python -m build
- uses: actions/upload-artifact@v1
with:
name: dist
path: dist
publish:
runs-on: ubuntu-latest
needs: [build, build-wheels]
if: github.event_name == 'release'
steps:
- name: Download a distribution artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Use Python 3.11
uses: actions/setup-python@v1
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install twine
- name: Publish distribution 📦 to PyPI
run: |
twine upload -r pypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}