Skip to content

Commit

Permalink
update python
Browse files Browse the repository at this point in the history
  • Loading branch information
hspark1212 committed Nov 27, 2023
1 parent 4de149a commit 50f1544
Showing 1 changed file with 47 additions and 129 deletions.
176 changes: 47 additions & 129 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,147 +1,65 @@
name: Build wheels
name: Build Wheels

on:
push:
branches:
- develop-hs # update
- main # release

workflow_dispatch:
inputs:

flavours:
type: boolean
default: true

skeleton:
description: 'skeleton: if set, should be 1 or 2.'
type: string

sdist:
type: boolean
default: true

wheels:
type: boolean
default: true

wheels_linux_auto:
type: boolean
default: true

wheels_linux_aarch64:
type: boolean
default: true

wheels_windows_auto:
type: boolean
default: true

wheels_macos_auto:
type: boolean
default: true

wheels_macos_arm64:
type: boolean
default: true

wheels_cps:
description: 'wheels_cps: sets $CIBW_BUILD, E.g. "cp310* cp311*".'
type: string

# We can't currently have more than 10 inputs
#wheels_cp38:
# type: boolean
# default: true
#
#wheels_cp39:
# type: boolean
# default: true
#
#wheels_cp310:
# type: boolean
# default: true
#
#wheels_cp311:
# type: boolean
# default: true
on: [push, pull_request]
# pull_request:
# branches:
# - main
# push:
# branches:
# - main
# tags:
# - 'v0.1.*'

jobs:

build_sdist:
if: ${{ inputs.sdist }}
name: Build sdist
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
#with:
# fetch-depth: 0 # Optional, use if you use setuptools_scm
# submodules: true # Optional, use if you have submodules

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz


build_wheels:
if: ${{ inputs.wheels }}
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2019, macos-latest]
matrix:
os: [macos-latest, ubuntu-latest, windows-2019]
python-version: [3.8]

# Avoid cancelling of all cibuildwheel runs after a single failure.
fail-fast: false

steps:

- uses: actions/checkout@v2

# Get Python for running cibuildwheel. This also ensures that 'python'
# works on MacOS, where it seems only 'python3' is available by default.
# Get Python 3.12 x32 and x64 on Windows. (As of 2023-10-12 these are not
# always available by default.)
#
- uses: actions/setup-python@v2
- name: Install Python 3.12 x32 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v2
with:
python-version: '3.12'
architecture: x86
- name: Install Python 3.12 x64 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v2
with:
python-version: '3.12'

# On Linux, get qemu so we can build for aarch64.
#
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
platforms: all
python-version: ${{ matrix.python-version }}

- name: gh_release
# Doesn't seem to be a way to passing inputs.* on command
# line, so we set environment instead. E.g. see:
# https://github.com/orgs/community/discussions/27088
#
env:
inputs_flavours: ${{inputs.flavours}}
inputs_skeleton: ${{inputs.skeleton}}
inputs_sdist: ${{inputs.sdist}}
inputs_wheels: ${{inputs.wheels}}
inputs_wheels_linux_aarch64: ${{inputs.wheels_linux_aarch64}}
inputs_wheels_macos_arm64: ${{inputs.wheels_macos_arm64}}
inputs_wheels_linux_auto: ${{inputs.wheels_linux_auto}}
inputs_wheels_windows_auto: ${{inputs.wheels_windows_auto}}
inputs_wheels_macos_auto: ${{inputs.wheels_macos_auto}}
inputs_wheels_cps: ${{inputs.wheels_cps}}

#inputs_wheels_cp38: ${{inputs.wheels_cp38}}
#inputs_wheels_cp39: ${{inputs.wheels_cp39}}
#inputs_wheels_cp310: ${{inputs.wheels_cp310}}
#inputs_wheels_cp311: ${{inputs.wheels_cp311}}
run:
python scripts/gh_release.py

- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

# Upload generated wheels, to be accessible from github Actions page.
#
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
path: ./wheelhouse/*.whl

- name: Publish Wheels
if: startsWith(github.ref, 'refs/tags/')
run: |
pip install twine
python -m twine upload wheelhouse/*.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

0 comments on commit 50f1544

Please sign in to comment.