-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
105 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,90 +12,117 @@ env: | |
miniforge_variant: "Mambaforge" | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build sdist | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Build distribution | ||
run: | | ||
# set version from '${{ github.ref_name }}' | ||
export RELEASE_VERSION=${{ github.ref_name }} | ||
pip install numpy cython | ||
pipx run build --sdist | ||
python setup.py sdist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
|
||
# adapted from | ||
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | ||
build_wheels: | ||
name: Build wheels (py ${{ matrix.pyver }}) ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-13, macos-14] | ||
pyver: ["37", "38", "39", "310", "311", "312"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Python packaging tools | ||
run: | | ||
pip install numpy cython | ||
python -m pip install --upgrade pip setuptools wheel | ||
- name: Build wheels (py ${{ matrix.pyver }}) Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
env: | ||
CIBW_ARCHS_LINUX: "x86_64 aarch64" | ||
CIBW_SKIP: "*-musllinux*" | ||
CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
|
||
uses: pypa/[email protected] | ||
|
||
- name: Build wheels (py ${{ matrix.pyver }}) MacOS | ||
if: matrix.os == 'macos-latest' | ||
env: | ||
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | ||
CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
|
||
uses: pypa/[email protected] | ||
|
||
- name: Build wheels (py ${{ matrix.pyver }}) Windows | ||
if: matrix.os == 'windows-latest' | ||
env: | ||
CIBW_ARCHS_WINDOWS: "amd64 win32" | ||
CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
|
||
uses: pypa/[email protected] | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ matrix.pyver }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
|
||
release: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
|
||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Check artifacts | ||
run: ls -lrt dist/ | ||
|
||
- name: Publish Distribution | ||
uses: pypa/[email protected] | ||
- name: Publish a Python distribution to PyPI | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
# wheels are not working | ||
# cutting them out did not "just" work | ||
# getting a release out right now is more important than | ||
# precompiled builds. | ||
#jobs: | ||
# build_sdist: | ||
# name: Build sdist | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# | ||
# - name: Build distribution | ||
# run: | | ||
# pip install numpy cython | ||
# pipx run build --sdist | ||
# | ||
# - uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: cibw-sdist | ||
# path: dist/*.tar.gz | ||
# | ||
# # adapted from | ||
# # https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml | ||
# build_wheels: | ||
# name: Build wheels (py ${{ matrix.pyver }}) ${{ matrix.os }} | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# matrix: | ||
# os: [ubuntu-latest, macos-13, macos-14] | ||
# pyver: ["37", "38", "39", "310", "311", "312"] | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# | ||
# - name: Install Python packaging tools | ||
# run: | | ||
# pip install numpy cython | ||
# python -m pip install --upgrade pip setuptools wheel | ||
# | ||
# - name: Build wheels (py ${{ matrix.pyver }}) Linux | ||
# if: matrix.os == 'ubuntu-latest' | ||
# env: | ||
# CIBW_ARCHS_LINUX: "x86_64 aarch64" | ||
# CIBW_SKIP: "*-musllinux*" | ||
# CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
# | ||
# uses: pypa/[email protected] | ||
# | ||
# - name: Build wheels (py ${{ matrix.pyver }}) MacOS | ||
# if: matrix.os == 'macos-latest' | ||
# env: | ||
# CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | ||
# CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
# | ||
# uses: pypa/[email protected] | ||
# | ||
# - name: Build wheels (py ${{ matrix.pyver }}) Windows | ||
# if: matrix.os == 'windows-latest' | ||
# env: | ||
# CIBW_ARCHS_WINDOWS: "amd64 win32" | ||
# CIBW_BUILD: "cp${{ matrix.pyver }}-*" | ||
# | ||
# uses: pypa/[email protected] | ||
# | ||
# - uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: cibw-wheels-${{ matrix.os }}-${{ matrix.pyver }}-${{ strategy.job-index }} | ||
# path: ./wheelhouse/*.whl | ||
# | ||
# release: | ||
# needs: [build_wheels, build_sdist] | ||
# runs-on: ubuntu-latest | ||
# environment: pypi | ||
# permissions: | ||
# id-token: write | ||
# | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
# steps: | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: cibw-* | ||
# path: dist | ||
# merge-multiple: true | ||
# | ||
# - name: Check artifacts | ||
# run: ls -lrt dist/ | ||
# | ||
# - name: Publish Distribution | ||
# uses: pypa/[email protected] | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_API_TOKEN }} |