Skip to content

Commit

Permalink
build: Remove unnecessary build configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Oct 30, 2023
1 parent ce8aebf commit 52387b9
Showing 1 changed file with 104 additions and 117 deletions.
221 changes: 104 additions & 117 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -70,14 +69,15 @@ jobs:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.outputs.tag
# if: needs.release.outputs.tag

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
cibw_archs: ["x86_64"]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
cibw_build: ["cp39-*"]
cibw_archs: ["x86_64", "aarch64"]

steps:
- name: Check out repository
Expand Down Expand Up @@ -118,14 +118,15 @@ jobs:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.outputs.tag
# if: needs.release.outputs.tag

strategy:
fail-fast: false
matrix:
os: [macos-latest]
cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
cibw_archs: ["x86_64"]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
cibw_build: ["cp39-*"]
cibw_archs: ["x86_64", "arm64"]
env:
SYSTEM_VERSION_COMPAT: 0 # https://github.com/actions/setup-python/issues/469#issuecomment-1192522949
steps:
Expand All @@ -145,20 +146,6 @@ jobs:
virtualenvs-create: false
virtualenvs-in-project: false

- name: Configure Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install Dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Do not run brew cleanup automatically.
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 # Do not automatically update packages.
run: |
brew install openssl@3
ln -sf $(brew --prefix openssl)/include/openssl /usr/local/include/openssl
ln -sf $(brew --prefix openssl)/lib/*a /usr/local/lib/
ln -sf $(brew --prefix openssl)/lib/*dylib /usr/local/lib/
- name: Build wheels
uses: pypa/[email protected]
env:
Expand All @@ -169,102 +156,102 @@ jobs:
with:
path: wheelhouse/*.whl

build_wheels_macos_arm64:
name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
runs-on: ${{ matrix.os }}
needs: ["release"]
if: needs.release.outputs.tag
strategy:
matrix:
os: [macos-latest]
cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
cibw_archs: ["arm64"]

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Configure Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install Dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Do not run brew cleanup automatically.
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 # Do not automatically update packages.
run: |
brew install openssl@3
ln -sf $(brew --prefix openssl)/include/openssl /usr/local/include/openssl
ln -sf $(brew --prefix openssl)/lib/*a /usr/local/lib/
ln -sf $(brew --prefix openssl)/lib/*dylib /usr/local/lib/
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_REPAIR_WHEEL_COMMAND: |
echo "Target delocate archs: {delocate_archs}"
ORIGINAL_WHEEL={wheel}
echo "Running delocate-listdeps to list linked original wheel dependencies"
DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-listdeps --all $ORIGINAL_WHEEL
echo "Renaming .whl file when architecture is 'macosx_arm64'"
RENAMED_WHEEL=${ORIGINAL_WHEEL//x86_64/arm64}
echo "Wheel will be renamed to $RENAMED_WHEEL"
mv $ORIGINAL_WHEEL $RENAMED_WHEEL
echo "Running delocate-wheel command on $RENAMED_WHEEL"
DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v $RENAMED_WHEEL
echo "Running delocate-listdeps to list linked wheel dependencies"
WHEEL_SIMPLE_FILENAME="${RENAMED_WHEEL##*/}"
DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-listdeps --all {dest_dir}/$WHEEL_SIMPLE_FILENAME
echo "DONE."
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

upload_to_pypi:
needs:
[
"release",
"build_wheels_macos_arm64",
"build_wheels_macos",
"build_wheels_linux",
]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3

- name: Publish package on PyPI
if: needs.release.outputs.tag
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
packages_dir: artifact/

- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ needs.release.outputs.tag != '' }}
tag: ${{ needs.release.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build_wheels_macos_arm64:
# name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}"
# runs-on: ${{ matrix.os }}
# needs: ["release"]
# if: needs.release.outputs.tag
# strategy:
# matrix:
# os: [macos-latest]
# cibw_build: ["cp39-*", "cp310-*", "cp311-*"]
# cibw_archs: ["arm64"]

# steps:
# - name: Check out repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - uses: actions/setup-python@v4
# with:
# python-version: "3.10"

# - name: Configure Homebrew
# uses: Homebrew/actions/setup-homebrew@master

# - name: Install Dependencies
# env:
# HOMEBREW_NO_AUTO_UPDATE: 1
# HOMEBREW_NO_INSTALL_CLEANUP: 1 # Do not run brew cleanup automatically.
# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 # Do not automatically update packages.
# run: |
# brew install openssl@3
# ln -sf $(brew --prefix openssl)/include/openssl /usr/local/include/openssl
# ln -sf $(brew --prefix openssl)/lib/*a /usr/local/lib/
# ln -sf $(brew --prefix openssl)/lib/*dylib /usr/local/lib/

# - name: Build wheels
# uses: pypa/[email protected]
# env:
# CIBW_BUILD: ${{ matrix.cibw_build }}
# CIBW_ARCHS: ${{ matrix.cibw_archs }}
# CIBW_TEST_SKIP: "*-macosx_arm64"
# CIBW_REPAIR_WHEEL_COMMAND: |
# echo "Target delocate archs: {delocate_archs}"

# ORIGINAL_WHEEL={wheel}

# echo "Running delocate-listdeps to list linked original wheel dependencies"
# DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-listdeps --all $ORIGINAL_WHEEL

# echo "Renaming .whl file when architecture is 'macosx_arm64'"
# RENAMED_WHEEL=${ORIGINAL_WHEEL//x86_64/arm64}

# echo "Wheel will be renamed to $RENAMED_WHEEL"
# mv $ORIGINAL_WHEEL $RENAMED_WHEEL

# echo "Running delocate-wheel command on $RENAMED_WHEEL"
# DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v $RENAMED_WHEEL

# echo "Running delocate-listdeps to list linked wheel dependencies"
# WHEEL_SIMPLE_FILENAME="${RENAMED_WHEEL##*/}"
# DYLD_LIBRARY_PATH=$LIBRARY_PATH delocate-listdeps --all {dest_dir}/$WHEEL_SIMPLE_FILENAME

# echo "DONE."

# - uses: actions/upload-artifact@v3
# with:
# path: ./wheelhouse/*.whl

# upload_to_pypi:
# needs:
# [
# "release",
# "build_wheels_macos_arm64",
# "build_wheels_macos",
# "build_wheels_linux",
# ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3

# - name: Publish package on PyPI
# if: needs.release.outputs.tag
# uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# skip_existing: true
# packages_dir: artifact/

# - name: Publish the release notes
# uses: release-drafter/[email protected]
# with:
# publish: ${{ needs.release.outputs.tag != '' }}
# tag: ${{ needs.release.outputs.tag }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

upload_to_test_pypi:
needs: ["release"]
Expand Down

0 comments on commit 52387b9

Please sign in to comment.