Skip to content

Commit

Permalink
Very frustrating
Browse files Browse the repository at this point in the history
  • Loading branch information
wasade committed May 11, 2024
1 parent 3b678ce commit 0d84b83
Showing 1 changed file with 56 additions and 64 deletions.
120 changes: 56 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,76 @@ jobs:

- name: Build distribution
run: |
export RELEASE_VERSION=${{ github.ref_name }}
pip install numpy cython
pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: dist-artifacts
name: cibw-sdist
path: dist/*.tar.gz

# adapted from
# wheels are not working, have to delay a fix
#build_wheels:
# name: Build wheels (py ${{ matrix.pyver }}) ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest]
# pyver: ["37", "38", "39", "310", "311", "312"]

# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.9

# - name: Install Python packaging tools
# run: |
# export RELEASE_VERSION=${{ github.ref_name }}
# pip install numpy cython
# python -m pip install --upgrade pip setuptools wheel

# # https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
# - 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]

# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: dist-artifacts
# path: ./wheelhouse/*.whl
# 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]
needs: build_sdist
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# this is not ideal as it doesn't limit to what type of tag
# but it at least seems to work
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment: pypi
permissions:
id-token: write

if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Stage artifacts
uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist-artifacts
path: dist/
name: cibw-*
path: dist
merge-multiple: true

- name: Check artifacts
run: ls -lrt dist/
Expand Down

0 comments on commit 0d84b83

Please sign in to comment.