Skip to content

Commit 1144db3

Browse files
committed
src: check against platform specific versions for latest and unstable
Check against platform and package specific version numbers returned from pkgs.tailscale.com instead of defaulting to "Version" as this can be incorrect for certain platforms when a release has only been built for a subset of platforms. For example. 1.90.2 is available for linux at the time of writing so "Version" is 1.90.2, but only 1.90.1 is available for windows which causes an error when using latest as the version specifier on windows machines. Fixes #219 Signed-off-by: Mario Minardi <mario@tailscale.com>
1 parent c17f550 commit 1144db3

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

dist/index.js

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,17 @@ async function resolveVersion(
262262
pkg,
263263
]);
264264
const response = JSON.parse(stdout);
265-
return response.Version;
265+
switch (runnerOS) {
266+
case runnerLinux:
267+
return response.TarballsVersion;
268+
case runnerMacOS:
269+
// Use latest tag on macOS since we are building from source
270+
return response.Version;
271+
case runnerWindows:
272+
return response.MSIsVersion;
273+
default:
274+
return response.Version;
275+
}
266276
}
267277

268278
return version;

0 commit comments

Comments
 (0)