77 python-version :
88 description : " Python version to use for the build"
99 required : true
10- sed-i :
11- description : " Sed in-place command for the OS"
10+ shells :
11+ description : " Shell configuration for the OS"
1212 required : true
1313 github-token :
1414 required : true
@@ -21,77 +21,49 @@ runs:
2121
2222 # - - -
2323
24- - name : (Linux) Install ca-certificates
25- if : runner.os == 'Linux'
26- shell : bash -l {0}
27- run : |
28- # (Linux) Install ca-certificates
29- set -e
30- set -u
31- set -o pipefail
32-
33- apt-get update -qq
34- DEBIAN_FRONTEND=noninteractive apt-get install -qq ca-certificates > /dev/null 2>&1
35-
36- # - - -
37-
38- - name : Set up Python ${{ inputs.python-version }} via micromamba
39- uses : mamba-org/setup-micromamba@v2
40- with :
41- environment-file : environment-ocpaddons-${{ inputs.python-version }}.yml
42- log-level : warning
43- init-shell : bash
44- cache-downloads : true
45- cache-environment : true
46- cache-environment-key : environment-ocpaddons-${{ inputs.python-version }}-${{ inputs.os }}-novtk
47-
48- # - - -
49-
5024 - name : Install Linux Dependencies (x86_64)
5125 if : runner.os == 'Linux'
52- shell : bash -l {0}
26+ shell : bash -leo pipefail {0}
5327 run : |
5428 # Install Linux Dependencies (x86_64)
55- set -e
56- set -o pipefail
5729
5830 apt-get update -qq
59- apt-get install -qq -y freetype* libfreetype6-dev libgl1-mesa-glx git \
60- patch gcc g++ build-essential > /dev/null 2>&1
61-
62- pip install auditwheel patchelf build wheel
63- micromamba info
64- micromamba list
31+ apt-get install -qq -y freetype* libfreetype6-dev libgl1-mesa-glx git \
32+ ca-certificates patch gcc g++ build-essential > /dev/null 2>&1
6533
6634 # - - -
6735
6836 - name : Install MacOS Dependencies (x86_64 / arm64)
6937 if : runner.os == 'macOS'
70- shell : bash -l {0}
38+ shell : bash -leo pipefail {0}
7139 run : |
7240 # Install MacOS Dependencies (x86_64 / arm64)
73- set -e
74- set -o pipefail
75-
76- brew install automake gsed tree
77-
78- pip install delocate build wheel
7941
80- # curl -L -O https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz
81- # sudo tar -xf MacOSX11.3.sdk.tar.xz -C /opt
42+ brew install gsed
43+ # ensure gnu sed is in PATH before system (BSD) sed
44+ sudo ln -s "$(brew --prefix gnu-sed)/libexec/gnubin/sed" /usr/local/bin/sed
8245
8346 # - - -
84-
85- - name : Install Windows Dependencies (x86_64)
86- if : runner.os == 'Windows'
87- shell : bash -l {0}
47+
48+ - name : Prepare environment.yml
49+ shell : bash -leo pipefail {0}
8850 run : |
89- # Install Windows Dependencies (x86_64)
90- set -e
91- set -o pipefail
92-
93- micromamba install vs2019_win-64 -c conda-forge
94- pip install delvewheel build wheel
51+ # Install Linux Dependencies (x86_64)
52+
53+ sed -i 's/__PY_VERSION__/${{ inputs.python-version }}/' environment-ocpaddons.yml
54+
55+ cat environment-ocpaddons.yml
56+
57+ # - - -
58+
59+ - name : Set up Python ${{ inputs.python-version }} via micromamba
60+ uses : mamba-org/setup-micromamba@v2
61+ with :
62+ environment-file : environment-ocpaddons.yml
63+ log-level : warning
64+ init-shell : ${{ inputs.shells }}
65+ cache-environment : true
66+ cache-environment-key : environment-ocpaddons-${{ inputs.python-version }}-${{ inputs.os }}-novtk
9567
9668 # - - -
9769
@@ -105,23 +77,43 @@ runs:
10577 # - - -
10678
10779 - name : Clone ocp-addons and build wheel
108- shell : bash -l {0}
80+ if : runner.os != 'Windows'
81+ shell : bash -leo pipefail {0}
82+ env :
83+ OCCT_SDK : ${{ github.workspace }}/occt-${{ env.OCCT }}-novtk
10984 run : |
11085 # Clone ocp-addons and build wheel
111- set -e
112- set -o pipefail
11386
11487 git clone https://github.com/jdegenstein/ocp-addons.git
115-
11688 cd ocp-addons
11789 git switch ocp-build-system
11890
119- export OCCT_SDK="$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk"
12091 python -m build -n -w
12192 ls -l dist
12293
12394 # - - -
12495
96+ - name : Clone ocp-addons and build wheel
97+ if : runner.os == 'Windows'
98+ shell : cmd
99+ env :
100+ OCCT_SDK : ${{ github.workspace }}\occt-${{ env.OCCT }}-novtk
101+ run : |
102+ rem Clone ocp-addons and build wheel
103+
104+ call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
105+ set CC=cl.exe
106+ set CXX=cl.exe
107+
108+ git clone https://github.com/jdegenstein/ocp-addons.git
109+ cd ocp-addons
110+ git switch ocp-build-system
111+
112+ micromamba run -n build-ocp python -m build -n -w
113+ dir dist
114+
115+ # - - -
116+
125117 - name : Upload wheel
126118 uses : actions/upload-artifact@v4
127119 with :
@@ -132,34 +124,32 @@ runs:
132124
133125 - name : Repair Linux Wheel (x86_64)
134126 if : runner.os == 'Linux'
135- shell : bash -l {0}
127+ shell : bash -leo pipefail {0}
136128 run : |
137129 # Repair Linux Wheel (x86_64)
138-
139- set -e
140- set -o pipefail
141130
131+ pip install auditwheel patchelf
132+
142133 cd ocp-addons
143- VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
134+ VERSION=$(python setup.py --version )
144135
145- env LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib auditwheel repair \
136+ LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib auditwheel repair \
146137 --plat manylinux_2_31_x86_64 dist/ocp_addons-${VERSION}*.whl
147138
148139 # - - -
149140
150141 - name : Repair MacOS Wheel (x86_64 / arm64)
151142 if : runner.os == 'macOS'
152- shell : bash -l {0}
143+ shell : bash -leo pipefail {0}
153144 run : |
154145 # Repair MacOS Wheel (x86_64 / arm64)
155-
156- set -e
157- set -o pipefail
158146
147+ pip install delocate
148+
159149 cd ocp-addons
160- VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
150+ VERSION=$(python setup.py --version )
161151
162- # Patch @rpath/libc++.1.dylib to /usr/lib/libc++.1.dylib
152+ # Patch @rpath/libc++.1.dylib to /usr/lib/libc++.1.dylib to ensure delocate works successfully
163153 cd dist
164154 python -m wheel unpack ocp_addons-${VERSION}*.whl
165155
@@ -174,7 +164,6 @@ runs:
174164 python -m wheel pack ocp_addons-${VERSION}
175165 cd ..
176166
177- # @rpath/libc++.1.dylib confuses delocate but can safely be ignored
178167 DYLD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib:/usr/lib python \
179168 -m delocate.cmd.delocate_wheel \
180169 --ignore-missing-dependencies \
@@ -184,17 +173,18 @@ runs:
184173
185174 - name : Repair Windows Wheel (x86_64)
186175 if : runner.os == 'Windows'
187- shell : bash -l {0}
176+ shell : bash -leo pipefail {0}
188177 run : |
189178 # Repair Windows Wheel (x86_64)
190- set -e
191- set -o pipefail
192-
179+
180+ pip install delvewheel
181+
193182 cd ocp-addons
194- VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
183+ VERSION=$(python setup.py --version)
184+
185+ ls -l $GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/win64/vc14/bin
195186
196- PATH=LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib:$PATH
197- python -m delvewheel repair --wheel-dir=wheelhouse dist/ocp_addons-${VERSION}*.whl
187+ PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/win64/vc14/bin:$PATH python -m delvewheel repair --wheel-dir=wheelhouse dist/ocp_addons-${VERSION}*.whl
198188
199189 # - - -
200190
0 commit comments