File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ const minisign = require('./minisign');
11
11
const MINISIGN_KEY = 'RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U' ;
12
12
13
13
// The base URL of the official builds of Zig. This is only used as a fallback, if all mirrors fail.
14
- const CANONICAL = 'https://ziglang.org/builds' ;
14
+ const CANONICAL_DEV = 'https://ziglang.org/builds' ;
15
+ const CANONICAL_RELEASE = 'https://ziglang.org/download' ;
15
16
16
17
// The URL of the mirror list. This should be an ASCII-encoded text file, with one mirror per LF-separated line.
17
18
const MIRRORS_URL = 'https://ziglang.org/download/community-mirrors.txt' ;
@@ -74,8 +75,12 @@ async function downloadTarball(tarball_filename) {
74
75
// continue loop to next mirror
75
76
}
76
77
}
77
- core . info ( `Attempting official: ${ CANONICAL } ` ) ;
78
- return await downloadFromMirror ( CANONICAL , tarball_filename ) ;
78
+
79
+ // As a fallback, attempt ziglang.org.
80
+ const zig_version = tarball_filename . match ( / \d + \. \d + \. \d + ( - d e v \. \d + \+ [ 0 - 9 a - f ] + ) ? / ) [ 0 ] ;
81
+ const canonical = zig_version . includes ( "-dev" ) ? CANONICAL_DEV : `${ CANONICAL_RELEASE } /${ zig_version } ` ;
82
+ core . info ( `Attempting official: ${ canonical } ` ) ;
83
+ return await downloadFromMirror ( canonical , tarball_filename ) ;
79
84
}
80
85
81
86
async function retrieveTarball ( tarball_name , tarball_ext ) {
You can’t perform that action at this time.
0 commit comments