-
Notifications
You must be signed in to change notification settings - Fork 860
Support 32-bit architecture #57
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ export async function getJava( | |
|
|
||
| const contents = await response.readBody(); | ||
| const refs = contents.match(/<a href.*\">/gi) || []; | ||
| const downloadInfo = getDownloadInfo(refs, version, javaPackage); | ||
| const downloadInfo = getDownloadInfo(refs, version, arch, javaPackage); | ||
| jdkFile = await tc.downloadTool(downloadInfo.url); | ||
| version = downloadInfo.version; | ||
| compressedFileExtension = IS_WINDOWS ? '.zip' : '.tar.gz'; | ||
|
|
@@ -188,20 +188,33 @@ async function unzipJavaDownload( | |
| function getDownloadInfo( | ||
| refs: string[], | ||
| version: string, | ||
| arch: string, | ||
| javaPackage: string | ||
| ): {version: string; url: string} { | ||
| version = normalizeVersion(version); | ||
|
|
||
| let archExtension = ''; | ||
| if (arch === 'x86') { | ||
| archExtension = 'i686'; | ||
| } else if (arch === 'x64') { | ||
| archExtension = 'x64'; | ||
| } else { | ||
| throw new Error(`architecture "${arch}" is not int [x86 | x64]`); | ||
|
Contributor
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. We should validate that the architecture input is valid when we retrieve the input in https://github.com/actions/setup-java/blob/master/src/setup-java.ts#L12 Then this whole block can just be:
Contributor
Author
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. Indeed. I'm not very familiar with the GitHub Actions core library (and JS in general) so bear with me. I'll make the change soon.
Contributor
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. No worries! Let me know if you need any help 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. Should be "not in" instead of "not int". |
||
| } | ||
|
|
||
| let extension = ''; | ||
| if (IS_WINDOWS) { | ||
| extension = `-win_x64.zip`; | ||
| extension = `-win_${archExtension}.zip`; | ||
| } else { | ||
| if (process.platform === 'darwin') { | ||
| extension = `-macosx_x64.tar.gz`; | ||
| extension = `-macosx_${archExtension}.tar.gz`; | ||
| } else { | ||
| extension = `-linux_x64.tar.gz`; | ||
| extension = `-linux_${archExtension}.tar.gz`; | ||
| } | ||
| } | ||
|
|
||
| core.debug(`Searching for files with extension: ${extension}`); | ||
|
|
||
| let pkgRegexp = new RegExp(''); | ||
| let pkgTypeLength = 0; | ||
| if (javaPackage === 'jdk') { | ||
|
|
||
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.
Where did this extension come from? Is it not
x86?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.
i686is the latest iteration of theIA-32(commonly known asx86). From today's perspective, it's a synonym ofx86(although it is technically not). I didn't choose this extension, I just looked at https://cdn.azul.com/zulu/bin/ and saw that's what they use.