CIBW_BEFORE_BUILD_LINUX use apt to install #60
Workflow file for this run
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
name: pylibCZIrw | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
pylibczirwVersion: | |
description: "pylibCZIrw version" | |
required: true | |
default: "4.1.1" | |
cibwVersion: | |
description: "cibuildwheel version" | |
default: "2.18.1" | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*" | |
CIBW_VERSION: ${{ inputs.cibwVersion || '2.18.1'}} | |
PYLIBCZIRW_VERSION: ${{ inputs.pylibczirwVersion || '4.1.1'}} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Download pylibCZIrw | |
run: | | |
curl -o pypi.json "https://pypi.org/pypi/pylibczirw/${PYLIBCZIRW_VERSION}/json" | |
URL=$(python -c "import json, sys; print([u for u in json.load(sys.stdin)['urls'] if u['url'].endswith('.tar.gz')][0]['url'])" < pypi.json) | |
curl -o pylibCZIrw.tar.gz $URL | |
tar -xvf pylibCZIrw.tar.gz | |
mv pylibCZIrw-${PYLIBCZIRW_VERSION} pylibCZIrw | |
- name: Fix cmake for Mac | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
sed -i '' 's/CMAKE_OSX_DEPLOYMENT_TARGET "10.9"/CMAKE_OSX_DEPLOYMENT_TARGET "12.0"/g' pylibCZIrw/CMakeLists.txt | |
sed -i '' 's/ENDIF(APPLE)/ set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Architectures for OS X" FORCE)\r\nENDIF(APPLE)/g' pylibCZIrw/CMakeLists.txt | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | |
CIBW_ARCHS_MACOS: "universal2" | |
CIBW_ARCHS_LINUX: "x86_64" | |
CIBW_ARCHS_WINDOWS: "AMD64" | |
#CIBW_BEFORE_BUILD_LINUX: apt-get install libssl-dev | |
CIBW_BEFORE_BUILD_LINUX: apt update && apt install -y libssl-dev | |
with: | |
package-dir: ./pylibCZIrw | |
output-dir: wheelhouse | |
#config-file: "{package}/pyproject.toml" | |
- name: Fix platform tags for Mac | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
for f in ./pylibCZIrw/wheelhouse/*.whl ; do mv $f ${f//macosx_12_0/macosx_10_9} ; done | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./pylibCZIrw/wheelhouse/*.whl | |
publish: | |
name: Publish wheels to pypi.scm.io | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get wheels | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
- name: Publish to pypy.scm.io | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.PYPI_SCM_USERNAME }} | |
password: ${{ secrets.PYPI_SCM_PASSWORD }} | |
repository-url: https://pypi.scm.io/simple/ | |
skip-existing: true |