Skip to content

Commit c306637

Browse files
chore: more robust downloading of crane
1 parent d95435d commit c306637

File tree

2 files changed

+52
-56
lines changed

2 files changed

+52
-56
lines changed

.github/workflows/retag-containers-after-push.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,32 @@ jobs:
9595
# where to download the archive to
9696
archive_path=${temp_path}/${file_name}
9797
98-
# fetch releases
99-
curl \
100-
--silent \
101-
--location \
102-
--output ${json_path} \
103-
https://api.github.com/repos/google/go-containerregistry/releases/latest
104-
105-
url_to_krane=$(cat ${json_path} |\
106-
jq \
107-
--raw-output \
108-
".assets.[] | select(.browser_download_url | contains(\"${file_name}\")) | .browser_download_url"
109-
)
110-
111-
# Download archive
112-
curl \
113-
--silent \
114-
--location \
115-
--output ${archive_path} \
116-
$url_to_krane
117-
118-
cd ${temp_path}
119-
120-
# extract archive
121-
tar \
122-
--verbose \
123-
--extract \
124-
--gunzip \
125-
--file ./${file_name}
98+
url_to_krane=$(wget \
99+
--output-document=- \
100+
--timeout=10 \
101+
--waitretry=3 \
102+
--retry-connrefused \
103+
--progress=dot:mega \
104+
"https://api.github.com/repos/google/go-containerregistry/releases/latest" \
105+
| jq \
106+
--raw-output \
107+
".assets.[] | select(.browser_download_url | contains(\"${file_name}\")) | .browser_download_url")
108+
109+
wget \
110+
--output-document=- \
111+
--timeout=10 \
112+
--waitretry=3 \
113+
--retry-connrefused \
114+
--progress=dot:mega \
115+
"${url_to_krane}" \
116+
| tar \
117+
--directory=${temp_path}/ \
118+
--strip-components=0 \
119+
--no-overwrite-dir \
120+
--extract \
121+
--verbose \
122+
--gunzip \
123+
--file=-
126124
127125
# append to path
128126
echo "${temp_path}" >> ${GITHUB_PATH}

.github/workflows/retag-containers-after-release.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,34 +59,32 @@ jobs:
5959
# where to download the archive to
6060
archive_path=${temp_path}/${file_name}
6161
62-
# fetch releases
63-
curl \
64-
--silent \
65-
--location \
66-
--output ${json_path} \
67-
https://api.github.com/repos/google/go-containerregistry/releases/latest
68-
69-
url_to_krane=$(cat ${json_path} |\
70-
jq \
71-
--raw-output \
72-
".assets.[] | select(.browser_download_url | contains(\"${file_name}\")) | .browser_download_url"
73-
)
74-
75-
# Download archive
76-
curl \
77-
--silent \
78-
--location \
79-
--output ${archive_path} \
80-
$url_to_krane
81-
82-
cd ${temp_path}
83-
84-
# extract archive
85-
tar \
86-
--verbose \
87-
--extract \
88-
--gunzip \
89-
--file ./${file_name}
62+
url_to_krane=$(wget \
63+
--output-document=- \
64+
--timeout=10 \
65+
--waitretry=3 \
66+
--retry-connrefused \
67+
--progress=dot:mega \
68+
"https://api.github.com/repos/google/go-containerregistry/releases/latest" \
69+
| jq \
70+
--raw-output \
71+
".assets.[] | select(.browser_download_url | contains(\"${file_name}\")) | .browser_download_url")
72+
73+
wget \
74+
--output-document=- \
75+
--timeout=10 \
76+
--waitretry=3 \
77+
--retry-connrefused \
78+
--progress=dot:mega \
79+
"${url_to_krane}" \
80+
| tar \
81+
--directory=${temp_path}/ \
82+
--strip-components=0 \
83+
--no-overwrite-dir \
84+
--extract \
85+
--verbose \
86+
--gunzip \
87+
--file=-
9088
9189
# append to path
9290
echo "${temp_path}" >> ${GITHUB_PATH}

0 commit comments

Comments
 (0)