1
- # This is a basic workflow to help you get started with Actions
2
- name : build
1
+ name : Build pypylon
3
2
4
3
# Controls when the action will run.
5
4
on :
23
22
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
24
23
25
24
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
30
27
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
45
70
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
64
76
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
69
82
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
75
89
90
+ outputs :
91
+ is_release_build : ${{ steps.check_release_build.outputs.env.release_build == '1' }}
76
92
77
93
build-linux :
78
- needs : prepare
79
- runs-on : ubuntu-22.04
94
+ needs : setup
95
+ runs-on : ubuntu-latest
80
96
strategy :
81
97
fail-fast : false
82
98
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]
85
101
86
102
env :
87
103
P : ${{ matrix.p }}
@@ -90,15 +106,21 @@ jobs:
90
106
# Steps represent a sequence of tasks that will be executed as part of the job
91
107
steps :
92
108
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
93
- - uses : actions/checkout@v3
109
+ - uses : actions/checkout@v4
94
110
with :
95
111
fetch-depth : 0
96
112
97
- - uses : actions/download-artifact@v3
113
+ # download the pylon sdks
114
+ - name : download linux artifacts
115
+ uses : actions/download-artifact@v4
98
116
with :
99
- name : pylon-installer
117
+ pattern : Linux*Pylon
118
+ merge-multiple : true
100
119
path : pylon-installer
101
120
121
+ - name : Display Structure of downloaded files
122
+ run : ls -R pylon-installer
123
+
102
124
- name : Build with docker
103
125
run : |
104
126
pwd
@@ -107,103 +129,106 @@ jobs:
107
129
docker run --rm --privileged multiarch/qemu-user-static:register --reset
108
130
./scripts/build/build-arch.sh --platform-tag $P --abi-tag $A --pylon-dir ./pylon-installer $ARGS
109
131
132
+ # TODO: can we use v4 here?
110
133
- uses : actions/upload-artifact@v3
111
134
with :
112
135
name : build-results-${{ matrix.p }}-${{ matrix.a }}
113
136
path : dist/*
114
137
115
138
- name : Upload Release Asset
116
- if : needs.prepare .outputs.is_release_build == 'true'
139
+ if : needs.setup .outputs.is_release_build == 'true'
117
140
uses : softprops/action-gh-release@v1
118
141
env :
119
142
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
120
143
with :
121
144
files : dist/*
122
145
123
146
- 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' )
125
148
run : |
126
149
sudo pip3 install twine
127
150
python3 -m twine upload --non-interactive --skip-existing dist/*
128
151
129
152
130
153
build-windows :
131
- needs : prepare
132
- runs-on : windows-2019
154
+ needs : setup
155
+ runs-on : windows-latest
133
156
strategy :
134
157
fail-fast : false
135
158
steps :
136
- - uses : actions/checkout@v3
159
+ - uses : actions/checkout@v4
137
160
138
161
- name : Install Python
139
162
uses : actions/setup-python@v4
140
163
with :
141
- python-version : " 3.6 - 3.11 "
164
+ python-version : " 3.9 - 3.12 "
142
165
143
- - uses : actions/download-artifact@v3
166
+ - uses : actions/download-artifact@v4
144
167
with :
145
- name : pylon-installer
168
+ name : Windows_Pylon
146
169
path : pylon-installer
147
170
171
+ - name : Display Structure of downloaded files
172
+ run : dir pylon-installer
173
+
148
174
- name : Setup pylon
149
175
run : |
150
176
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
153
180
154
181
- name : Build wheels
155
-
156
- env :
157
- PYLON_DEV_DIR : " C:\\ Program Files\\ Basler\\ pylon 7\\ Development"
182
+
158
183
159
184
- uses : actions/upload-artifact@v3
160
185
with :
161
186
path : ./wheelhouse/*.whl
162
187
163
188
- name : Upload Release Asset
164
- if : needs.prepare .outputs.is_release_build == 'true'
189
+ if : needs.setup .outputs.is_release_build == 'true'
165
190
uses : softprops/action-gh-release@v1
166
191
env :
167
192
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
168
193
with :
169
194
files : ./wheelhouse/*.whl
170
195
171
196
- name : Publish package to (Test)PyPI
172
- if : needs.prepare .outputs.is_release_build == 'true'
197
+ if : needs.setup .outputs.is_release_build == 'true'
173
198
run : |
174
199
python -m pip install twine
175
200
python -m twine upload --non-interactive --skip-existing wheelhouse\\*
176
201
shell : cmd
177
-
202
+
178
203
179
204
build-macos :
180
- needs : prepare
181
- runs-on : macos-11
205
+ needs : setup
206
+ runs-on : macos-latest
182
207
strategy :
183
208
fail-fast : false
184
209
steps :
185
- - uses : actions/checkout@v3
210
+ - uses : actions/checkout@v4
186
211
187
212
- name : Install Python
188
213
uses : actions/setup-python@v4
189
214
with :
190
- python-version : " 3.6 - 3.11 "
215
+ python-version : " 3.9 - 3.12 "
191
216
192
- - uses : actions/download-artifact@v3
217
+ - uses : actions/download-artifact@v4
193
218
with :
194
- name : pylon-installer
219
+ name : macOS_Pylon
195
220
path : pylon-installer
196
221
197
222
- name : Setup pylon
198
223
run : |
199
224
# install universal
200
225
cd pylon-installer
201
- hdiutil attach pylon_ *.dmg
226
+ hdiutil attach pylon- *.dmg
202
227
sudo installer -pkg /Volumes/pylon\ *\ Camera\ Software\ Suite/pylon-*.pkg -target /
203
228
hdiutil detach /Volumes/pylon\ *\ Camera\ Software\ Suite
204
229
205
230
- name : Build wheels
206
- uses : pypa/cibuildwheel@v2.13.0
231
+ uses : pypa/cibuildwheel@v2.19
207
232
env :
208
233
PYLON_FRAMEWORK_ARM64 : /Library/Frameworks
209
234
PYLON_FRAMEWORK_X86_64 : /Library/Frameworks
@@ -213,32 +238,36 @@ jobs:
213
238
path : ./wheelhouse/*.whl
214
239
215
240
- name : Upload Release Asset
216
- if : needs.prepare .outputs.is_release_build == 'true'
241
+ if : needs.setup .outputs.is_release_build == 'true'
217
242
uses : softprops/action-gh-release@v1
218
243
env :
219
244
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
220
245
with :
221
246
files : ./wheelhouse/*.whl
222
247
223
248
- name : Publish package to (Test)PyPI
224
- if : needs.prepare .outputs.is_release_build == 'true'
249
+ if : needs.setup .outputs.is_release_build == 'true'
225
250
run : |
226
251
sudo pip3 install twine
227
252
python3 -m twine upload --non-interactive --skip-existing wheelhouse/*
228
253
229
254
cleanup :
230
255
if : always()
231
256
needs : [
232
- prepare ,
257
+ setup ,
233
258
build-linux,
234
259
build-macos,
235
260
build-windows
236
261
]
237
262
runs-on : ubuntu-latest
238
263
steps :
239
- - uses : geekyeggo/delete-artifact@v2
264
+ - uses : geekyeggo/delete-artifact@v5
240
265
continue-on-error : true
241
266
with :
242
- name : pylon-installer
267
+ name : |
268
+ Linux_x86_64_Pylon
269
+ Linux_aarch64_Pylon
270
+ Windows_Pylon
271
+ macOS_Pylon
243
272
244
273
0 commit comments