Skip to content

Commit d43bbfc

Browse files
authored
Merge pull request #4 from activeloopai/wheel-build-fix
Fixed wheel build.
2 parents 8d7ec20 + ede0402 commit d43bbfc

3 files changed

Lines changed: 316 additions & 69 deletions

File tree

.github/workflows/wheel-build.yaml

Lines changed: 93 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ on:
2323
description: "Build Linux ARM Wheels"
2424
type: boolean
2525
default: true
26+
runner:
27+
description: Choose MacOS Action Runner Type
28+
type: choice
29+
options:
30+
- "self-hosted"
31+
- "macos-12"
32+
- "macos-13"
33+
- "macos-14"
34+
- "macos-15"
35+
default: "self-hosted"
2636

2737
env:
28-
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
29-
VCPKG_FEATURE_FLAGS: "dependencygraph"
38+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
39+
VCPKG_FEATURE_FLAGS: dependencygraph
3040
VCPKG_DISABLE_METRICS: true
3141
BUILD_PRESET: "release"
3242

@@ -67,42 +77,110 @@ jobs:
6777
build_wheels-macos:
6878
name: MacOS Wheels Build
6979
needs: [get_macos_matrix]
70-
runs-on: self-hosted-${{ matrix.type }}
80+
runs-on: ${{ inputs.runner }}-${{ matrix.type }}
7181
strategy:
7282
fail-fast: false
7383
matrix:
7484
include: ${{ fromJSON(needs.get_macos_matrix.outputs.matrix) }}
75-
env:
76-
VCPKG_BINARY_SOURCES: "clear;files,/Users/sre/GitHub/vcpkg-cache-deepframe-${{ matrix.type }},readwrite"
85+
7786
steps:
87+
- name: set platform name
88+
id: platform-name
89+
shell: bash
90+
env:
91+
TYPE: ${{ matrix.type }}
92+
run: |
93+
case "${TYPE}" in
94+
xlarge)
95+
echo "platform=macosx_11_0_arm64" >> $GITHUB_OUTPUT
96+
echo "arch=arm64" >> $GITHUB_OUTPUT
97+
echo "triplet=arm64-osx" >> $GITHUB_OUTPUT
98+
;;
99+
large)
100+
echo "platform=macosx_10_9_x86_64" >> $GITHUB_OUTPUT
101+
echo "arch=x86_64" >> $GITHUB_OUTPUT
102+
echo "triplet=x64-osx" >> $GITHUB_OUTPUT
103+
;;
104+
esac
105+
106+
- name: set vcpkg cache path
107+
id: vcpkg-cache
108+
shell: bash
109+
env:
110+
ARCH: ${{ steps.platform-name.outputs.arch }}
111+
run: |
112+
echo "cache_path=/Users/sre/GitHub/vcpkg-cache-deepframe-${{ steps.platform-name.outputs.triplet }}" >> $GITHUB_OUTPUT
113+
78114
- name: clone repository
79115
uses: actions/checkout@v4.2.2
80116

117+
- name: setup python ${{ matrix.python }}
118+
uses: actions/setup-python@v5.3.0
119+
if: inputs.runner != 'self-hosted'
120+
with:
121+
python-version: ${{ matrix.python }}
122+
81123
- name: setup python ${{ matrix.python }} environment
82124
id: setup
83125
shell: bash
84126
run: |-
85127
python${{ matrix.python }} -m venv "venv_${{ matrix.venv }}"
86128
source "venv_${{ matrix.venv }}/bin/activate"
87-
python"${{ matrix.python }}" -m pip install -qqq -U pip setuptools build; deactivate
129+
python"${{ matrix.python }}" -m pip install -qqq -U pip setuptools build cmake==3.29.2
130+
deactivate
131+
echo -e "\n[bdist_wheel]\nplat-name = ${{ steps.platform-name.outputs.platform }}" >> setup.cfg
88132
89133
- name: install vcpkg
90134
shell: bash
91-
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 1de2026f28ead93ff1773e6e680387643e914ea1 && ./bootstrap-vcpkg.sh
135+
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 6f29f12e82a8293156836ad81cc9bf5af41fe836 && ./bootstrap-vcpkg.sh
136+
137+
- name: install vcpkg dependencies
138+
shell: bash
139+
env:
140+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
141+
VCPKG_TARGET_TRIPLET: ${{ steps.platform-name.outputs.triplet }}
142+
VCPKG_HOST_TRIPLET: ${{ steps.platform-name.outputs.triplet }}
143+
run: |
144+
cd vcpkg
145+
./vcpkg install --triplet=${{ steps.platform-name.outputs.triplet }} openssl liblzma libiconv zlib
146+
cd ..
147+
148+
- name: clean build artifacts
149+
shell: bash
150+
run: |
151+
# Clean build directory to ensure fresh build
152+
rm -rf build
153+
# Clean architecture-specific FFmpeg installations
154+
rm -rf .ext-*
92155
93156
- name: build py${{ matrix.python }}
157+
env:
158+
CMAKE_OSX_ARCHITECTURES: ${{ steps.platform-name.outputs.arch }}
159+
VCPKG_TARGET_TRIPLET: ${{ steps.platform-name.outputs.triplet }}
160+
VCPKG_HOST_TRIPLET: ${{ steps.platform-name.outputs.triplet }}
161+
VCPKG_BINARY_SOURCES: "clear"
162+
VCPKG_DISABLE_METRICS: true
163+
VCPKG_OVERLAY_TRIPLETS: ""
164+
VCPKG_OVERLAY_PORTS: ""
94165
shell: bash
95166
run: |-
167+
CMAKE_PATH=$(whereis cmake | awk '{print $2}')
168+
CMAKE_DIR=$(dirname "$CMAKE_PATH")
169+
echo "$CMAKE_DIR" >> $GITHUB_PATH
170+
96171
source "venv_${{ matrix.venv }}/bin/activate"
97172
python"${{ matrix.python }}" -m pip install -r requirements-dev.txt &&
98173
python"${{ matrix.python }}" scripts/build.py "${{ env.BUILD_PRESET }}"
99-
python"${{ matrix.python }}" -m build; deactivate
174+
python"${{ matrix.python }}" -m build
175+
deactivate
100176
101177
- name: run tests
178+
if: matrix.type != 'x86_64'
102179
shell: bash
103180
run: |-
104181
source "venv_${{ matrix.venv }}/bin/activate"
105-
timeout -k 10s 30m python"${{ matrix.python }}" -m pytest; deactivate
182+
timeout -k 10s 30m python"${{ matrix.python }}" -m pytest
183+
deactivate
106184
107185
- uses: actions/upload-artifact@v4.6.1
108186
if: ${{ always() }}
@@ -159,13 +237,18 @@ jobs:
159237
shell: bash
160238
run: git clone -b "${{ github.ref_name }}" "https://activeloop-bot:${{ secrets.ORG_GH_BOT_PAT }}@github.com/${{ github.repository }}" .
161239

240+
- name: setup environment
241+
shell: bash
242+
run: |
243+
echo -e "\n[bdist_wheel]\nplat-name = manylinux2014_${{ matrix.type }}" >> setup.cfg
244+
162245
- name: download vcpkg cache
163246
shell: bash
164247
run: source scripts/build_scripts/get_creds.sh && python3.11 scripts/build_scripts/manage_cache.py download deepframe
165248

166249
- name: install vcpkg
167250
shell: bash
168-
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 1de2026f28ead93ff1773e6e680387643e914ea1 && ./bootstrap-vcpkg.sh
251+
run: git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 6f29f12e82a8293156836ad81cc9bf5af41fe836 && ./bootstrap-vcpkg.sh
169252

170253
- name: build py${{ matrix.python }}
171254
shell: bash

0 commit comments

Comments
 (0)