11# This is a basic workflow to help you get started with Actions
22name : build
33
4- # Controls when the action will run.
4+ # Controls when the action will run.
55on :
66 # Triggers the workflow on push or pull request events but only for the master branch
77 push :
88 branches :
99 - ' **'
1010 tags :
11- - ' *.*.*'
11+ - ' *.*.*'
1212 pull_request :
1313 branches : [ master ]
1414
3434 ${PYLON_DOWNLOAD_URL_BASE_7_2}pylon_7.2.1.25747_x86_64_setup.tar.gz
3535 ${PYLON_DOWNLOAD_URL_BASE_7_2}pylon_7.2.1.25747_aarch64_setup.tar.gz
3636 ${PYLON_DOWNLOAD_URL_BASE}pylon_6.2.0.21487_armhf_setup.tar.gz
37- ${PYLON_DOWNLOAD_URL_BASE}pylon-6.1.2.19990.zip
37+ ${PYLON_DOWNLOAD_URL_BASE}pylon-6.2.0.21487.dmg
38+ ${PYLON_DOWNLOAD_ARM64_URL_BASE}pylon_7.3.1.0006_Darwin-arm64_SDK.selfsh
3839 EOF
3940 - uses : actions/cache@v3
4041 id : cache
4950 PYLON_DOWNLOAD_URL_BASE_6_2 : ${{ secrets.PYLON_DOWNLOAD_URL_BASE_6_2 }}
5051 PYLON_DOWNLOAD_URL_BASE_6_3 : ${{ secrets.PYLON_DOWNLOAD_URL_BASE_6_3 }}
5152 PYLON_DOWNLOAD_URL_BASE_7_2 : ${{ secrets.PYLON_DOWNLOAD_URL_BASE_7_2 }}
53+ PYLON_DOWNLOAD_ARM64_URL_BASE : ${{ secrets.PYLON_DOWNLOAD_ARM64_URL_BASE }}
5254 run : |
5355 mkdir pylon-installer && cd pylon-installer
5456 while read line; do
6466 with :
6567 name : pylon-installer
6668 path : pylon-installer
67-
69+
6870 - name : Check for release build
6971 if : startsWith(github.ref, 'refs/tags/')
7072 run : |
@@ -104,12 +106,12 @@ jobs:
104106 ls pylon-installer
105107 docker run --rm --privileged multiarch/qemu-user-static:register --reset
106108 ./scripts/build/build-arch.sh --platform-tag $P --abi-tag $A --pylon-dir ./pylon-installer $ARGS
107-
109+
108110 - uses : actions/upload-artifact@v3
109111 with :
110112 name : build-results-${{ matrix.p }}-${{ matrix.a }}
111113 path : dist/*
112-
114+
113115 - name : Upload Release Asset
114116 if : needs.prepare.outputs.is_release_build == 'true'
115117 uses : softprops/action-gh-release@v1
@@ -123,89 +125,57 @@ jobs:
123125 run : |
124126 sudo pip3 install twine
125127 python3 -m twine upload --non-interactive --skip-existing dist/*
126-
127-
128+
129+
128130 build-macos :
129131 needs : prepare
130- runs-on : macos-10.15
132+ runs-on : macos-11
131133 strategy :
132134 fail-fast : false
133- matrix :
134- a : [cp36, cp37, cp38, cp39, cp3_10, cp3_11]
135- env :
136- P : macosx-10.15-intel
137- A : ${{ matrix.a }}
138135 steps :
139136 - uses : actions/checkout@v3
140-
137+
138+ - name : Install Python
139+ uses : actions/setup-python@v4
140+ with :
141+ python-version : " 3.6 - 3.11"
142+
141143 - uses : actions/download-artifact@v3
142144 with :
143145 name : pylon-installer
144146 path : pylon-installer
145147
146-
147- - name : Build and test
148+ - name : Setup pylon
148149 run : |
149- eval "$(pyenv init -)"
150- export PATH=$HOME/.pyenv/bin:$PATH
151- case $A in
152- cp36)
153- PYENV_VERSION="3.6"
154- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg"
155- ;;
156- cp37)
157- PYENV_VERSION="3.7"
158- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg"
159- ;;
160- cp38)
161- PYENV_VERSION="3.8"
162- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.8.7/python-3.8.7-macosx10.9.pkg"
163- ;;
164- cp39)
165- PYENV_VERSION="3.9"
166- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.9.1/python-3.9.1-macosx10.9.pkg"
167- ;;
168- cp3_10)
169- PYENV_VERSION="3.10"
170- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.10.2/python-3.10.2-macos11.pkg"
171- ;;
172- cp3_11)
173- PYENV_VERSION="3.11"
174- curl -sSfL -o python.pkg "https://www.python.org/ftp/python/3.11.0/python-3.11.0-macos11.pkg"
175- ;;
176- *)
177- echo "Invalid python version $A"
178- exit -1
179- ;;
180- esac
181- sudo installer -pkg python.pkg -target /
150+ # install x86_64
182151 cd pylon-installer
183- unzip pylon-*.zip
184152 hdiutil attach pylon-*.dmg
185153 sudo installer -pkg /Volumes/pylon\ *\ Camera\ Software\ Suite/pylon-*.pkg -target /
186154 hdiutil detach /Volumes/pylon\ *\ Camera\ Software\ Suite
187- brew install swig
188- cd ${GITHUB_WORKSPACE}
189- pip3 install numpy
190- pip3 install wheel
191- # pylon 6.1 is linked against 10.14
192- export MACOSX_DEPLOYMENT_TARGET=10.14
193- python3 setup.py test
194- python3 setup.py bdist_wheel
195-
155+ # install arm64
156+ chmod a+x pylon_7.3.1.0006_Darwin-arm64_SDK.selfsh
157+ ./pylon_7.3.1.0006_Darwin-arm64_SDK.selfsh --accept
158+ mkdir /tmp/pylon_framework
159+ cp -pr pylon/Frameworks/* /tmp/pylon_framework
160+
161+ - name : Build wheels
162+ 163+ env :
164+ PYLON_FRAMEWORK_ARM64 : /tmp/pylon_framework
165+ PYLON_FRAMEWORK_X86_64 : /Library/Frameworks
166+
196167 - uses : actions/upload-artifact@v3
197168 with :
198- name : build-results-macosx-${{ matrix.a }}
199- path : dist/*
200-
169+ path : ./wheelhouse/*.whl
170+
201171 - name : Upload Release Asset
202172 if : needs.prepare.outputs.is_release_build == 'true'
203173 uses : softprops/action-gh-release@v1
204174 env :
205175 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206176 with :
207- files : dist/*
208-
177+ files : ./wheelhouse/*.whl
178+
209179 - name : Publish package to (Test)PyPI
210180 if : needs.prepare.outputs.is_release_build == 'true'
211181 run : |
@@ -226,4 +196,4 @@ jobs:
226196 with :
227197 name : pylon-installer
228198
229-
199+
0 commit comments