Skip to content

Commit 937d07d

Browse files
committed
CI: fix XIMEA URL
1 parent 465f939 commit 937d07d

File tree

4 files changed

+37
-12
lines changed

4 files changed

+37
-12
lines changed

.github/scripts/Linux/install_others.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ if [ "$(id -u)" -eq 0 ]; then
77
fi
88

99
install_ximea() {
10-
if [ "$(dpkg --print-architecture | cut -b1-3)" = arm ]; then
11-
filename=XIMEA_Linux_ARM_SP.tgz
12-
else
13-
filename=XIMEA_Linux_SP.tgz
14-
fi
15-
curl -LO https://www.ximea.com/downloads/recent/$filename
10+
filename=XIMEA.tgz
11+
curl -L "$XIMEA_DOWNLOAD_URL" -o "$filename"
1612
tar xzf $filename
1713
cd package
1814
sudo ./install -noudev

.github/scripts/environment.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,36 @@ if [ "$(uname -s)" = Darwin ] && [ "$(uname -m)" != arm64 ]; then
116116
printf "UG_ARCH=%s\n" $UG_ARCH >> "$GITHUB_ENV"
117117
fi
118118

119+
120+
set_ximea_url() {
121+
if [ "$(uname -s)" = Darwin ]; then
122+
if [ "$(uname -m)" = arm64 ]; then
123+
ximea_pattern=XIMEA_macOS_ARM_SP.dmg
124+
else
125+
ximea_pattern=XIMEA_macOX_SP.dmg
126+
fi
127+
elif [ "$(uname -s)" = Linux ]; then
128+
if expr "$GITHUB_WORKFLOW" : ARM >/dev/null; then
129+
ximea_pattern=Linux_ARM_SP.tgz
130+
else
131+
ximea_pattern=Linux_SP.tgz
132+
fi
133+
else
134+
ximea_pattern=XIMEA_Windows_SP_Stable.exe
135+
fi
136+
# ignore GUID 35adfeed-8e15-4b4d-8364-bd5a65cba5c4 because it is
137+
# ARM (LTS) with pattern Linux_SP.tgz and since it listed first,
138+
# it will be downloaded for x86, ARM beta is OK
139+
ximea_path=$(curl https://www.ximea.com/software-downloads |
140+
grep -v 35adfeed-8e15-4b4d-8364-bd5a65cba5c4 |
141+
sed -n "/$ximea_pattern/"\
142+
' { s-^.*\(/getattachment[^"]*\).*$-\1-; p; q; }')
143+
XIMEA_DOWNLOAD_URL=https://www.ximea.com$ximea_path
144+
export XIMEA_DOWNLOAD_URL
145+
printf "XIMEA_DOWNLOAD_URL=%s\n" "$XIMEA_DOWNLOAD_URL" >> "$GITHUB_ENV"
146+
}
147+
set_ximea_url
148+
119149
import_signing_key() {
120150
if [ "$(uname -s)" != Darwin ] || [ -z "$apple_key_p12_b64" ]; then
121151
return 0

.github/scripts/macOS/install_others.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ fi
1919
install_ximea() {(
2020
installer=/private/var/tmp/XIMEA_OSX_SP.dmg
2121
if [ ! -f $installer ]; then
22-
curl -S -L https://www.ximea.com/downloads/recent/XIMEA_OSX_SP\
23-
.dmg -o $installer
22+
curl -S -L "$XIMEA_DOWNLOAD_URL" -o $installer
2423
fi
2524
hdiutil mount $installer
2625
sudo cp -a /Volumes/XIMEA/m3api.framework \

.github/workflows/ccpp.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
run: |
152152
echo "nonfree=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh "$SDK_URL/$DELTA_MAC_ARCHIVE")" >> $GITHUB_OUTPUT
153153
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Mac/Install_NDI_SDK_v6_Apple.pkg)" >> $GITHUB_OUTPUT
154-
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://www.ximea.com/downloads/recent/XIMEA_OSX_SP.dmg)" >> $GITHUB_OUTPUT
154+
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh "$XIMEA_DOWNLOAD_URL")" >> $GITHUB_OUTPUT
155155
- name: Set environment
156156
run: . .github/scripts/environment.sh
157157
- name: Run actions/cache for Non-Free SDKs
@@ -175,7 +175,7 @@ jobs:
175175
key: cache-ximea-${{ runner.os }}-${{ steps.etags.outputs.ximea }}
176176
- name: Download XIMEA
177177
if: steps.cache-macos-ximea.outputs.cache-hit != 'true'
178-
run: curl -S -L https://www.ximea.com/downloads/recent/XIMEA_OSX_SP.dmg -o /private/var/tmp/XIMEA_OSX_SP.dmg
178+
run: curl -S -L "$XIMEA_DOWNLOAD_URL" -o /private/var/tmp/XIMEA_OSX_SP.dmg
179179
- name: Run actions/cache for NDI
180180
id: cache-ndi
181181
uses: actions/cache@main
@@ -242,7 +242,7 @@ jobs:
242242
id: etags
243243
run: |
244244
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK/NDI%206%20SDK.exe)" >> $GITHUB_OUTPUT
245-
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://www.ximea.com/support/attachments/download/37/XIMEA_API_Installer.exe)" >> $GITHUB_OUTPUT
245+
echo "ximea=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh "$XIMEA_DOWNLOAD_URL")" >> $GITHUB_OUTPUT
246246
- name: Set environment
247247
run: .github/scripts/environment.sh
248248
- name: Find MSVC
@@ -265,7 +265,7 @@ jobs:
265265
key: cache-ximea-${{ runner.os }}-${{ steps.etags.outputs.ximea }}
266266
- name: Download XIMEA
267267
if: steps.cache-macos-ximea.outputs.cache-hit != 'true'
268-
run: curl 'https://www.ximea.com/support/attachments/download/37/XIMEA_API_Installer.exe' -o 'C:\XIMEA_API_Installer.exe'
268+
run: curl "$XIMEA_DOWNLOAD_URL" -o 'C:\XIMEA_API_Installer.exe'
269269

270270
- name: Run actions/cache for libajantv2 build
271271
id: cache-aja

0 commit comments

Comments
 (0)