forked from FloatingArrayDesign/MoorDyn
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: overhaul the python wheels crafting
- Loading branch information
1 parent
7114657
commit 92f2e98
Showing
4 changed files
with
140 additions
and
126 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
|
@@ -3,6 +3,11 @@ name: Python-manylinux-arch | |
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
description: 'Host OS' | ||
required: false | ||
type: string | ||
default: '["ubuntu-22.04"]' | ||
arch: | ||
description: 'Architecture target' | ||
required: true | ||
|
@@ -23,8 +28,16 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
|
||
os: ${{ fromJSON(inputs.os) }} | ||
env: | ||
# Skip 32-bit windows wheels builds. | ||
CIBW_SKIP: "*-win32*" | ||
CIBW_ARCHS: ${{inputs.arch}} | ||
CIBW_BEFORE_ALL: > | ||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DVTK_DIR=${{github.workspace}}/vtk/lib/cmake/vtk-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}/ -DMOORDYN_PACKAGE_IGNORE_VTK_DEPENDENCY=ON -DBUILD_TESTING=OFF && | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} && | ||
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -39,14 +52,37 @@ jobs: | |
python set_version.py | ||
python set_eigen_data.py | ||
rm set_version.py set_eigen_data.py | ||
cat pyproject.toml | ||
shell: bash | ||
|
||
- name: | ||
run: | | ||
if [ ${{inputs.os}} == '["ubuntu-22.04"]' ]; then | ||
echo "VTK_NAME=vtk-manylinux2014_${{inputs.arch}}.tar.gz" >> $GITHUB_ENV | ||
elif [ ${{inputs.os}} == '["macOS-latest"]' ]; then | ||
echo "VTK_NAME=vtk-macOS-x86_64.tar.gz" >> $GITHUB_ENV | ||
elif [ ${{inputs.os}} == '["windows-latest"]' ]; then | ||
echo "VTK_NAME=vtk-Windows-x86_64.tar.gz" >> $GITHUB_ENV | ||
else | ||
exit 255 | ||
fi | ||
- name: download pre-built VTK static library | ||
uses: suisei-cn/[email protected] | ||
with: | ||
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-manylinux2014_${{inputs.arch}}.tar.gz | ||
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/$VTK_NAME | ||
target: ${{github.workspace}}/ | ||
|
||
- name: Create folders | ||
run: | | ||
mkdir -p ${{github.workspace}}/vtk | ||
mkdir -p ${{github.workspace}}/build | ||
mkdir -p ${{github.workspace}}/install | ||
- name: Extract VTK tgz | ||
run: | | ||
tar -xvzf $VTK_NAME -C vtk/ | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Python-Wheels | |
|
||
on: | ||
push: | ||
branches: [ $default-branch, master ] | ||
branches: [ $default-branch, master, python ] | ||
|
||
permissions: write-all | ||
|
||
|
@@ -19,7 +19,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, windows-latest, macOS-latest] | ||
os: [ubuntu-22.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -34,145 +34,153 @@ jobs: | |
mv wrappers/python/wheels.github/* ./ | ||
python set_version.py | ||
python set_eigen_data.py | ||
rm set_version.py set_eigen_data.py | ||
rm set_version.py set_eigen_data.py | ||
cat pyproject.toml | ||
shell: bash | ||
|
||
- name: download pre-built VTK static library (non-Linux) | ||
uses: suisei-cn/[email protected] | ||
with: | ||
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-${{runner.os}}-x86_64.tar.gz | ||
target: ${{github.workspace}}/ | ||
if: runner.os != 'Linux' | ||
|
||
- name: download pre-built VTK static library (Linux-x86_64) | ||
uses: suisei-cn/[email protected] | ||
with: | ||
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-manylinux2014_x86_64.tar.gz | ||
target: ${{github.workspace}}/ | ||
if: runner.os == 'Linux' | ||
|
||
- name: download pre-built VTK static library (Linux-i686) | ||
uses: suisei-cn/[email protected] | ||
with: | ||
url: https://github.com/sanguinariojoe/vtk-builds/releases/download/VTK-${{env.VTK_VERSION_MAJOR}}.${{env.VTK_VERSION_MINOR}}.${{env.VTK_VERSION_PATCH}}-static/vtk-manylinux2014_i686.tar.gz | ||
target: ${{github.workspace}}/ | ||
if: runner.os == 'Linux' | ||
|
||
- name: Create folders | ||
run: | | ||
mkdir -p ${{github.workspace}}/vtk | ||
if: runner.os != 'Linux' | ||
|
||
- name: Extract VTK tgz | ||
run: | | ||
tar -xvzf vtk-${{runner.os}}-x86_64.tar.gz -C vtk/ | ||
if: runner.os != 'Linux' | ||
|
||
- name: Build the source distribution | ||
run: | | ||
python -m pip install -U pip setuptools | ||
python setup.py sdist | ||
if: runner.os == 'Linux' | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: all | ||
if: runner.os == 'Linux' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
with: | ||
output-dir: dist | ||
env: | ||
# configure cibuildwheel to build native archs ('auto'), and some | ||
# emulated ones | ||
CIBW_ARCHS_LINUX: auto | ||
# Skip 32-bit wheels builds as well as musllinux | ||
CIBW_SKIP: "*-win32 *musllinux*" | ||
CIBW_BEFORE_ALL_LINUX: > | ||
echo "Considering vtk-manylinux2014_`uname -m`.tar.gz..." && | ||
mkdir -p vtk && | ||
tar -xvzf vtk-manylinux2014_`uname -m`.tar.gz -C vtk/ | ||
- uses: actions/upload-artifact@v4 | ||
id: build_wheels | ||
with: | ||
name: python-wheels-${{runner.os}} | ||
name: python-wheels-sdist | ||
path: ./dist/* | ||
|
||
build_aarch64: | ||
name: Build Python wheels aarch64 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-manylinux-arch.yml@master | ||
build_Linux_x86_64: | ||
name: Build Linux_x86_64 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["ubuntu-22.04"]' | ||
arch: "x86_64" | ||
secrets: inherit | ||
|
||
build_Windows_AMD64: | ||
name: Build Windows_AMD64 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["windows-latest"]' | ||
arch: "AMD64" | ||
secrets: inherit | ||
|
||
build_MacOS_x86_64: | ||
name: Build Windows_x86_64 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["macOS-latest"]' | ||
arch: "x86_64" | ||
secrets: inherit | ||
|
||
build_Linux_i686: | ||
name: Build Linux_i686 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["ubuntu-22.04"]' | ||
arch: "i686" | ||
secrets: inherit | ||
|
||
build_Linux_aarch64: | ||
name: Build Linux_aarch64 | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["ubuntu-22.04"]' | ||
arch: "aarch64" | ||
secrets: inherit | ||
|
||
build_ppc64le: | ||
name: Build Python wheels ppc64le | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-manylinux-arch.yml@master | ||
build_Linux_ppc64le: | ||
name: Build Linux_ppc64le | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["ubuntu-22.04"]' | ||
arch: "ppc64le" | ||
secrets: inherit | ||
build_s390x: | ||
name: Build Python wheels s390x | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-manylinux-arch.yml@master | ||
|
||
build_Linux_s390x: | ||
name: Build Linux_s390x | ||
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@main | ||
with: | ||
os: '["ubuntu-22.04"]' | ||
arch: "s390x" | ||
secrets: inherit | ||
|
||
publish: | ||
runs-on: ${{ matrix.os }} | ||
needs: [build_wheels, build_aarch64, build_ppc64le, build_s390x] | ||
needs: [build_wheels, build_Linux_x86_64, build_Windows_AMD64, build_MacOS_x86_64, build_Linux_i686, build_Linux_aarch64, build_Linux_ppc64le, build_Linux_s390x] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download Linux x86_64 dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download sdist | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-sdist | ||
path: dist/ | ||
|
||
- name: Download Linux_x86_64 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-Linux | ||
name: python-wheels-Linux_x86_64 | ||
path: dist/ | ||
|
||
- name: Download MacOS x86_64 dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download Windows_AMD64 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-macOS | ||
name: python-wheels-Windows_AMD64 | ||
path: dist/ | ||
|
||
- name: Download Windows x86_64 dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download MacOS_x86_64 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-Windows | ||
name: python-wheels-MacOS_x86_64 | ||
path: dist/ | ||
|
||
- name: Download Linux aarch64 dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download Linux_i686 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-aarch64 | ||
name: python-wheels-Linux_i686 | ||
path: dist/ | ||
|
||
- name: Download Linux ppc64le dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download Linux_aarch64 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-ppc64le | ||
name: python-wheels-Linux_aarch64 | ||
path: dist/ | ||
|
||
- name: Download Linux s390x dists | ||
uses: actions/download-artifact@v4 | ||
- name: Download Linux_ppc64le | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-s390x | ||
name: python-wheels-Linux_ppc64le | ||
path: dist/ | ||
|
||
- name: Download Linux_s390x | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-Linux_s390x | ||
path: dist/ | ||
|
||
- name: Download MacOS_universal2 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-wheels-MacOS_universal2 | ||
path: dist/ | ||
|
||
- name: Publish package to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.MOORDYN_TESTPYPI_API }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
|
||
- name: Publish package to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
# password: ${{ secrets.MOORDYN_TESTPYPI_API }} | ||
# repository-url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.MOORDYN_PYPI_API }} | ||
repository-url: https://upload.pypi.org/legacy/ | ||
skip-existing: true | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
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