File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ check_command() {
9191 command -v " $1 " & > /dev/null || error " Required command not found: $1 . Install with: $2 "
9292}
9393
94+ artifacts_cached () {
95+ local version=" $1 "
96+ [[ -f " $WORK_DIR /.version" ]] && [[ " $( cat " $WORK_DIR /.version" ) " == " $version " ]]
97+ }
98+
9499check_git_clean () {
95100 log " Checking git status..."
96101
@@ -194,6 +199,12 @@ find_release_run_id() {
194199download_artifacts () {
195200 local version=" $1 "
196201 local tag=" v$version "
202+
203+ if artifacts_cached " $version " ; then
204+ log " Artifacts already downloaded for $version , skipping download"
205+ return
206+ fi
207+
197208 local tag_sha
198209 tag_sha=$( resolve_tag_sha " $tag " )
199210
@@ -233,13 +244,20 @@ download_artifacts() {
233244 --repo " $GITHUB_REPO " \
234245 --dir " $WORK_DIR "
235246
247+ echo " $version " > " $WORK_DIR /.version"
236248 log " Artifacts downloaded to $WORK_DIR "
237249 ls -la " $WORK_DIR "
238250}
239251
240252resume_download () {
241253 local version=" $1 "
242254 local tag=" v$version "
255+
256+ if artifacts_cached " $version " ; then
257+ log " Artifacts already downloaded for $version , skipping download"
258+ return
259+ fi
260+
243261 local tag_sha
244262 tag_sha=$( resolve_tag_sha " $tag " )
245263
@@ -268,6 +286,7 @@ resume_download() {
268286 --repo " $GITHUB_REPO " \
269287 --dir " $WORK_DIR "
270288
289+ echo " $version " > " $WORK_DIR /.version"
271290 log " Artifacts downloaded to $WORK_DIR "
272291 ls -la " $WORK_DIR "
273292}
You can’t perform that action at this time.
0 commit comments