@@ -28,38 +28,57 @@ jobs:
28
28
outputs :
29
29
is_release_build : ${{ env.RELEASE_BUILD == '1' }}
30
30
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
31
- uses : actions/cache@v3
41
32
id : cache
42
33
with :
43
34
path : pylon-installer
44
- key : pylon-installer-${{ hashFiles('pylon-installer.txt ') }}
35
+ key : pylon-installer-${{ hashFiles('pylon* ') }}
45
36
46
37
- name : Fetch installers
47
38
if : steps.cache.outputs.cache-hit != 'true'
48
39
env :
49
40
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
41
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
42
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
43
+ mkdir pylon-installer
44
+ cd pylon-installer
45
+ URLS=(
46
+ "${PYLON_DOWNLOAD_URL_BASE_7_4}pylon-7.4.0.14900_linux-x86_64_setup.tar.gz ${PYLON_DOWNLOAD_URL_BASE_7_4}pylon_7.4.0.14900_linux_x86_64_setup.tar.gz "
47
+ "${PYLON_DOWNLOAD_URL_BASE_7_4}pylon_7_4_0_14900_linux_aarch64_setup.tar.gz ${PYLON_DOWNLOAD_URL_BASE_7_4}pylon-7.4.0.14900_linux-aarch64_setup.tar.gz"
48
+ "${PYLON_DOWNLOAD_URL_BASE}pylon_6.2.0.21487_armhf_setup.tar.gz ${PYLON_DOWNLOAD_URL_BASE}pylon-6.2.0.21487-armhf_setup.tar.gz"
49
+ "${PYLON_DOWNLOAD_URL_BASE}pylon_7_3_1_0011.dmg"
50
+ "${PYLON_DOWNLOAD_URL_BASE}basler_pylon_7_4_0_14900.exe"
51
+ )
52
+
53
+ download_file() {
54
+ local url="$1"
55
+ local filename="${url##*/}"
56
+ wget -q "$url" -O "pylon-installer/$filename"
57
+ if [ $? -ne 0 ]; then
58
+ echo "Error downloading $filename"
59
+ return 1
60
+ fi
61
+ }
62
+
63
+ # Iterate through the list of possible download URLs
64
+ for sublist in "${URLS[@]}"; do
65
+ success=false
66
+ # Split the sublist into individual URLs
67
+ read -ra urls <<< "$sublist"
68
+ for url in "${urls[@]}"; do
69
+ download_file "$url"
70
+ if [ $? -eq 0 ]; then
71
+ echo "Downloaded $url"
72
+ success=true
73
+ break # Successfully downloaded, move to the next sublist
74
+ fi
75
+ done
76
+ if [ "$success" = false ]; then
77
+ echo "None of the URLs were successfully downloaded."
78
+ exit 1
79
+ fi
80
+ done
81
+ echo "All files downloaded successfully!"
63
82
md5sum *
64
83
65
84
- uses : actions/upload-artifact@v3
0 commit comments