-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
The binary zips we're putting up in GitHub release artifacts will be at URLs with the following pattern.
This issue is the sibling to #31403.
This is with the full release version that matches the release tag. That is for version 2.57.0, the tag is v2.57.0.
Since we're building with Go os and architecture tags, we may need to translate however we detect those to match the Go build terms.
OS: windows linux darwin
ARCH: amd64 arm64
darwin is the Mac/OSX version.
Detecting these in Java is pretty straight forward.
OS:
It boils down to System.getProperty("os.name") and do some processing to convert to the values we need.
Architecture would be with the os.arch property, and similar processing: with the important values being "AArch64" and "x86" for our immeadiate purposes.
We can write the file out as a zip file, and then read it in with https://docs.oracle.com/javase/8/docs/api/java/util/zip/ZipFile.html. Though there's probably a way to use the input stream directly so we only need to save the unpacked binary.
Making a http request in Java without extra library's appears to be https://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java