-
Notifications
You must be signed in to change notification settings - Fork 1.5k
download from node-versions and fallback to node dist #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ecf0ce6
wip
bryanmacfarlane 8885b71
updated tests
bryanmacfarlane 889def3
update ts-jest
bryanmacfarlane ec6092f
dbg
bryanmacfarlane 1c2f59f
format
bryanmacfarlane 22c0aea
cya snapshot
bryanmacfarlane 8a1d983
format
bryanmacfarlane efab84a
dist
bryanmacfarlane ed3a918
Merge pull request #153 from actions/start-v2
bryanmacfarlane 2bdb2ab
strip 1 on fallback extract
bryanmacfarlane 501fd29
Merge branch 'master' into node-versions
bryanmacfarlane e3ad114
dist
bryanmacfarlane 2fb08c4
update workflows
bryanmacfarlane 5e5ef8f
update
bryanmacfarlane 1b2d431
win change
bryanmacfarlane c8617ac
win change
bryanmacfarlane 42746a4
dbg
bryanmacfarlane a414557
dbg
bryanmacfarlane f7c5caf
dbg
bryanmacfarlane dd6f5ab
only node binary issue
bryanmacfarlane 11f9205
no proxy issue
bryanmacfarlane beb2155
testing 7z alt
bryanmacfarlane 9fcef3f
testing 7z alt
bryanmacfarlane 6a1b66a
dbg
bryanmacfarlane 8e22109
dbg
bryanmacfarlane 5e7b076
dbg
bryanmacfarlane a80a170
no proxy fix
bryanmacfarlane a875da2
output info
bryanmacfarlane 0a9e8b1
output info
bryanmacfarlane 2a0fbec
output info
bryanmacfarlane 2ae9264
back to master
bryanmacfarlane e73ffbc
support ghes (#157)
ericsciple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
only node binary issue
- Loading branch information
commit dd6f5ab66cf48404b904f678af44939c411f0c85
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,8 @@ export async function getNode( | |
downloadPath = await tc.downloadTool(info.downloadUrl, undefined, token); | ||
} catch (err) { | ||
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { | ||
return await acquireNodeFromFallbackLocation(info.resolvedVersion); | ||
await acquireNodeFromFallbackLocation(info.resolvedVersion); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a few really old versions like 0.12.8 will have a different layout without a targz or 7z. it will have just a node binary |
||
return; | ||
} | ||
|
||
throw err; | ||
|
@@ -269,6 +270,8 @@ async function acquireNodeFromFallbackLocation( | |
exeUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.exe`; | ||
libUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.lib`; | ||
|
||
console.log(`Downloading only node binary from ${exeUrl}`); | ||
|
||
const exePath = await tc.downloadTool(exeUrl); | ||
await io.cp(exePath, path.join(tempDir, 'node.exe')); | ||
const libPath = await tc.downloadTool(libUrl); | ||
|
@@ -286,7 +289,9 @@ async function acquireNodeFromFallbackLocation( | |
throw err; | ||
} | ||
} | ||
return await tc.cacheDir(tempDir, 'node', version); | ||
let toolPath = await tc.cacheDir(tempDir, 'node', version); | ||
core.addPath(toolPath); | ||
return toolPath; | ||
} | ||
|
||
// os.arch does not always match the relative download url, e.g. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this use info.token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when downloading from nodejs.org, shouldnt use a token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or would it better to check the hostname of the download url to determine whether to pass token?