Skip to content

Commit 6ec3905

Browse files
Merged PR 26362: Update GitHub build env for pylon 7.5
2 parents 741e6b8 + c1e834f commit 6ec3905

File tree

5 files changed

+165
-114
lines changed

5 files changed

+165
-114
lines changed

.github/workflows/build_config.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"linux-x86_64": {
3+
"pylon_sdks": ["7.5.0.15658"]
4+
},
5+
"linux-aarch64": {
6+
"pylon_sdks": ["7.5.0.15658"]
7+
},
8+
"windows": {
9+
"pylon_sdks": ["7.5.0.15658"]
10+
},
11+
"macos": {
12+
"pylon_sdks": ["7.3.1.0011"]
13+
}
14+
}

.github/workflows/main.yml

+112-83
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This is a basic workflow to help you get started with Actions
2-
name: build
1+
name: Build pypylon
32

43
# Controls when the action will run.
54
on:
@@ -23,65 +22,82 @@ env:
2322
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
2423

2524
jobs:
26-
prepare:
27-
runs-on: ubuntu-22.04
28-
outputs:
29-
is_release_build: ${{ env.RELEASE_BUILD == '1' }}
25+
setup:
26+
runs-on: ubuntu-latest
3027
steps:
31-
- name: Installer list
32-
run: |
33-
tee pylon-installer.txt <<"EOF"
34-
${PYLON_DOWNLOAD_URL_BASE_7_4}pylon_7.4.0.14900_linux_x86_64_setup.tar.gz
35-
${PYLON_DOWNLOAD_URL_BASE_7_4}pylon_7.4.0.14900_linux_aarch64_setup.tar.gz
36-
${PYLON_DOWNLOAD_URL_BASE}pylon_6.2.0.21487_armhf_setup.tar.gz
37-
${PYLON_DOWNLOAD_URL_BASE}pylon_7_3_1_0011.dmg
38-
${PYLON_DOWNLOAD_URL_BASE}basler_pylon_7_4_0_14900.exe
39-
EOF
40-
- uses: actions/cache@v3
41-
id: cache
42-
with:
43-
path: pylon-installer
44-
key: pylon-installer-${{ hashFiles('pylon-installer.txt') }}
28+
- uses: jfrog/setup-jfrog-cli@v4
29+
env:
30+
JF_URL: ${{ secrets.SDK_URL }}
31+
JF_ACCESS_TOKEN: ${{ secrets.SDK_TOKEN }}
32+
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
# login
37+
- run: |
38+
jf c add --url=$JF_URL --access-token=$JF_ACCESS_TOKEN --interactive=false
39+
40+
# download
41+
- name: Download files from Artifactory
42+
id: get_sdks
43+
run: |
44+
set +x
45+
set -e
46+
build_config=$(cat .github/workflows/build_config.json)
47+
for os in $(echo $build_config | jq -r 'keys[]'); do
48+
for pylon_sdk in $(echo $build_config | jq -r --arg os "$os" '.[$os].pylon_sdks[]'); do
49+
if [[ $os == "windows" || $os == "macos" ]]; then
50+
jf rt dl --flat --props "pylon_os=${os,,};pylon_version=$pylon_sdk" "pylon-sdks-generic/*" ./${os,,}_sdk/
51+
elif [[ $os == "linux-x86_64" ]]; then
52+
jf rt dl --flat --props "pylon_architecture=x86_64;pylon_os=linux;pylon_version=$pylon_sdk" "pylon-sdks-generic/*" ./linux_x86_64_sdk/
53+
elif [[ $os == "linux-aarch64" ]]; then
54+
jf rt dl --flat --props "pylon_architecture=aarch64;pylon_os=linux;pylon_version=$pylon_sdk" "pylon-sdks-generic/*" ./linux_aarch64_sdk/
55+
fi
56+
done
57+
done
58+
59+
- name: Upload Pylon SDK for Linux aarch64
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: Linux_aarch64_Pylon
63+
path: linux_aarch64_sdk
64+
65+
- name: Upload Pylon SDK for Linux x86_64
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: Linux_x86_64_Pylon
69+
path: linux_x86_64_sdk
4570

46-
- name: Fetch installers
47-
if: steps.cache.outputs.cache-hit != 'true'
48-
env:
49-
PYLON_DOWNLOAD_URL_BASE: ${{ secrets.PYLON_DOWNLOAD_URL_BASE }}
50-
PYLON_DOWNLOAD_URL_BASE_6_2: ${{ secrets.PYLON_DOWNLOAD_URL_BASE_6_2 }}
51-
PYLON_DOWNLOAD_URL_BASE_6_3: ${{ secrets.PYLON_DOWNLOAD_URL_BASE_6_3 }}
52-
PYLON_DOWNLOAD_URL_BASE_7_4: ${{ secrets.PYLON_DOWNLOAD_URL_BASE_7_4 }}
53-
PYLON_DOWNLOAD_ARM64_URL_BASE: ${{ secrets.PYLON_DOWNLOAD_ARM64_URL_BASE }}
54-
run: |
55-
mkdir pylon-installer && cd pylon-installer
56-
while read line; do
57-
url=$(eval echo "$line")
58-
echo "download $url"
59-
curl -sSfL -O "$url"
60-
done <../pylon-installer.txt
61-
echo "Download result"
62-
ls -l
63-
md5sum *
71+
- name: Upload Pylon SDK for Windows
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: Windows_Pylon
75+
path: windows_sdk
6476

65-
- uses: actions/upload-artifact@v3
66-
with:
67-
name: pylon-installer
68-
path: pylon-installer
77+
- name: Upload Pylon SDK for macOS
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: macOS_Pylon
81+
path: macos_sdk
6982

70-
- name: Check for release build
71-
if: startsWith(github.ref, 'refs/tags/')
72-
run: |
73-
echo "Build release for $GITHUB_REF"
74-
echo "RELEASE_BUILD=1" >> $GITHUB_ENV
83+
- name: Check for release build
84+
id: check_release_build
85+
if: startsWith(github.ref, 'refs/tags/')
86+
run: |
87+
echo "Build release for $GITHUB_REF"
88+
echo "release_build=1" >> $GITHUB_OUTPUT
7589
90+
outputs:
91+
is_release_build: ${{ steps.check_release_build.outputs.env.release_build == '1' }}
7692

7793
build-linux:
78-
needs: prepare
79-
runs-on: ubuntu-22.04
94+
needs: setup
95+
runs-on: ubuntu-latest
8096
strategy:
8197
fail-fast: false
8298
matrix:
83-
a: [cp36m, cp37m, cp38, cp39, cp3_10, cp3_11]
84-
p: [manylinux_2_31_x86_64, manylinux_2_31_aarch64, manylinux_2_28_armv7l]
99+
a: [cp39, cp3_10, cp3_11, cp3_12]
100+
p: [manylinux_2_31_x86_64, manylinux_2_31_aarch64]
85101

86102
env:
87103
P: ${{ matrix.p }}
@@ -90,15 +106,21 @@ jobs:
90106
# Steps represent a sequence of tasks that will be executed as part of the job
91107
steps:
92108
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
93-
- uses: actions/checkout@v3
109+
- uses: actions/checkout@v4
94110
with:
95111
fetch-depth: 0
96112

97-
- uses: actions/download-artifact@v3
113+
# download the pylon sdks
114+
- name: download linux artifacts
115+
uses: actions/download-artifact@v4
98116
with:
99-
name: pylon-installer
117+
pattern: Linux*Pylon
118+
merge-multiple: true
100119
path: pylon-installer
101120

121+
- name: Display Structure of downloaded files
122+
run: ls -R pylon-installer
123+
102124
- name: Build with docker
103125
run: |
104126
pwd
@@ -107,103 +129,106 @@ jobs:
107129
docker run --rm --privileged multiarch/qemu-user-static:register --reset
108130
./scripts/build/build-arch.sh --platform-tag $P --abi-tag $A --pylon-dir ./pylon-installer $ARGS
109131
132+
# TODO: can we use v4 here?
110133
- uses: actions/upload-artifact@v3
111134
with:
112135
name: build-results-${{ matrix.p }}-${{ matrix.a }}
113136
path: dist/*
114137

115138
- name: Upload Release Asset
116-
if: needs.prepare.outputs.is_release_build == 'true'
139+
if: needs.setup.outputs.is_release_build == 'true'
117140
uses: softprops/action-gh-release@v1
118141
env:
119142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120143
with:
121144
files: dist/*
122145

123146
- name: Publish package to (Test)PyPI
124-
if: needs.prepare.outputs.is_release_build == 'true' && startsWith( matrix.p, 'manylinux' )
147+
if: needs.setup.outputs.is_release_build == 'true' && startsWith( matrix.p, 'manylinux' )
125148
run: |
126149
sudo pip3 install twine
127150
python3 -m twine upload --non-interactive --skip-existing dist/*
128151
129152
130153
build-windows:
131-
needs: prepare
132-
runs-on: windows-2019
154+
needs: setup
155+
runs-on: windows-latest
133156
strategy:
134157
fail-fast: false
135158
steps:
136-
- uses: actions/checkout@v3
159+
- uses: actions/checkout@v4
137160

138161
- name: Install Python
139162
uses: actions/setup-python@v4
140163
with:
141-
python-version: "3.6 - 3.11"
164+
python-version: "3.9 - 3.12"
142165

143-
- uses: actions/download-artifact@v3
166+
- uses: actions/download-artifact@v4
144167
with:
145-
name: pylon-installer
168+
name: Windows_Pylon
146169
path: pylon-installer
147170

171+
- name: Display Structure of downloaded files
172+
run: dir pylon-installer
173+
148174
- name: Setup pylon
149175
run: |
150176
cd pylon-installer
151-
basler_pylon_7_4_0_14900.exe /quiet /install="GigE_Support;USB_Support;Camera_Link_Support;CoaXPress_Support;GenTL_Consumer_Support;CamEmu_Support;SDKs;DataProcessing_SDK"
152-
shell: cmd
177+
ren Basler-pylon-*.exe Basler-pylon.exe
178+
$process = Start-Process Basler-pylon.exe -Wait -ArgumentList '/quiet /install=GigE_Runtime;USB_Runtime;Camera_Link_Runtime;CoaXPress_Runtime;GenTL_Consumer_Support;CamEmu_Support;SDKs;DataProcessing_SDK' -PassThru
179+
Write-Host "Process finished with return code:" $process.ExitCode
153180
154181
- name: Build wheels
155-
uses: pypa/[email protected]
156-
env:
157-
PYLON_DEV_DIR: "C:\\Program Files\\Basler\\pylon 7\\Development"
182+
uses: pypa/[email protected]
158183

159184
- uses: actions/upload-artifact@v3
160185
with:
161186
path: ./wheelhouse/*.whl
162187

163188
- name: Upload Release Asset
164-
if: needs.prepare.outputs.is_release_build == 'true'
189+
if: needs.setup.outputs.is_release_build == 'true'
165190
uses: softprops/action-gh-release@v1
166191
env:
167192
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168193
with:
169194
files: ./wheelhouse/*.whl
170195

171196
- name: Publish package to (Test)PyPI
172-
if: needs.prepare.outputs.is_release_build == 'true'
197+
if: needs.setup.outputs.is_release_build == 'true'
173198
run: |
174199
python -m pip install twine
175200
python -m twine upload --non-interactive --skip-existing wheelhouse\\*
176201
shell: cmd
177-
202+
178203

179204
build-macos:
180-
needs: prepare
181-
runs-on: macos-11
205+
needs: setup
206+
runs-on: macos-latest
182207
strategy:
183208
fail-fast: false
184209
steps:
185-
- uses: actions/checkout@v3
210+
- uses: actions/checkout@v4
186211

187212
- name: Install Python
188213
uses: actions/setup-python@v4
189214
with:
190-
python-version: "3.6 - 3.11"
215+
python-version: "3.9 - 3.12"
191216

192-
- uses: actions/download-artifact@v3
217+
- uses: actions/download-artifact@v4
193218
with:
194-
name: pylon-installer
219+
name: macOS_Pylon
195220
path: pylon-installer
196221

197222
- name: Setup pylon
198223
run: |
199224
# install universal
200225
cd pylon-installer
201-
hdiutil attach pylon_*.dmg
226+
hdiutil attach pylon-*.dmg
202227
sudo installer -pkg /Volumes/pylon\ *\ Camera\ Software\ Suite/pylon-*.pkg -target /
203228
hdiutil detach /Volumes/pylon\ *\ Camera\ Software\ Suite
204229
205230
- name: Build wheels
206-
uses: pypa/cibuildwheel@v2.13.0
231+
uses: pypa/cibuildwheel@v2.19
207232
env:
208233
PYLON_FRAMEWORK_ARM64: /Library/Frameworks
209234
PYLON_FRAMEWORK_X86_64: /Library/Frameworks
@@ -213,32 +238,36 @@ jobs:
213238
path: ./wheelhouse/*.whl
214239

215240
- name: Upload Release Asset
216-
if: needs.prepare.outputs.is_release_build == 'true'
241+
if: needs.setup.outputs.is_release_build == 'true'
217242
uses: softprops/action-gh-release@v1
218243
env:
219244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
220245
with:
221246
files: ./wheelhouse/*.whl
222247

223248
- name: Publish package to (Test)PyPI
224-
if: needs.prepare.outputs.is_release_build == 'true'
249+
if: needs.setup.outputs.is_release_build == 'true'
225250
run: |
226251
sudo pip3 install twine
227252
python3 -m twine upload --non-interactive --skip-existing wheelhouse/*
228253
229254
cleanup:
230255
if: always()
231256
needs: [
232-
prepare,
257+
setup,
233258
build-linux,
234259
build-macos,
235260
build-windows
236261
]
237262
runs-on: ubuntu-latest
238263
steps:
239-
- uses: geekyeggo/delete-artifact@v2
264+
- uses: geekyeggo/delete-artifact@v5
240265
continue-on-error: true
241266
with:
242-
name: pylon-installer
267+
name: |
268+
Linux_x86_64_Pylon
269+
Linux_aarch64_Pylon
270+
Windows_Pylon
271+
macOS_Pylon
243272
244273

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=42", "swig>=4.2", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.cibuildwheel]
6-
skip = "pp*"
6+
skip = "pp* cp36-* cp37-* cp38-*"
77
build-verbosity = "0"
88
test-requires = "pytest numpy"
99

0 commit comments

Comments
 (0)