Skip to content

Commit

Permalink
Add Linux ARM64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
punmechanic committed Jul 31, 2023
1 parent 1425e56 commit 42e6757
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ func (c *Client) ListProviders(ctx context.Context, opts *ListProvidersOptions)
func getBinaryName() string {
switch runtime.GOOS {
case "linux":
return LinuxBinaryName
if runtime.GOARCH == "arm64" {
return LinuxArm64BinaryName
}

return LinuxAmd64BinaryName
case "windows":
return WindowsBinaryName
default:
Expand Down
3 changes: 2 additions & 1 deletion cli/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const DefaultTimeRemaining uint = 5
var DownloadURL string = "URL not set yet"

// CLI binary names
const LinuxBinaryName string = "keyconjurer-linux"
const LinuxAmd64BinaryName string = "keyconjurer-linux-amd64"
const LinuxArm64BinaryName string = "keyconjurer-linux-arm64"
const WindowsBinaryName string = "keyconjurer-windows.exe"
const DarwinArm64BinaryName string = "keyconjurer-darwin-arm64"
const DarwinAmd64BinaryName string = "keyconjurer-darwin-amd64"
Expand Down
7 changes: 6 additions & 1 deletion cli/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ endif
.PHONY: all build dir test build_requirements

all: \
../builds/$(RELEASE)/cli/keyconjurer-linux \
../builds/$(RELEASE)/cli/keyconjurer-linux-arm64 \
../builds/$(RELEASE)/cli/keyconjurer-linux-amd64 \
../builds/$(RELEASE)/cli/keyconjurer-darwin-amd64 \
../builds/$(RELEASE)/cli/keyconjurer-darwin-arm64 \
../builds/$(RELEASE)/cli/keyconjurer-windows.exe

../builds/$(RELEASE)/cli/keyconjurer-linux:
../builds/$(RELEASE)/cli/keyconjurer-linux-arm64:
../builds/$(RELEASE)/cli/keyconjurer-linux-amd64:
GOOS=linux GOARCH=amd64 BUILD_TARGET=keyconjurer-linux $(MAKE) build
GOOS=linux GOARCH=arm64 BUILD_TARGET=keyconjurer-linux-arm64 $(MAKE) build
cp ../builds/$(RELEASE)/cli/keyconjurer-linux ../builds/$(RELEASE)/cli/keyconjurer-linux-arm64

../builds/$(RELEASE)/cli/keyconjurer-darwin:
../builds/$(RELEASE)/cli/keyconjurer-darwin-amd64:
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/history.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ const History = () => (
{`${binaryName}`}-darwin (osx)
</a>
<br />
<a href={`${binaryName}-darwin-arm64`}>
{`${binaryName}`}-darwin (osx M1/M2)
<a href={`${binaryName}-linux-amd64`}>
{`${binaryName}`}-linux AMD64 (This is probably the one you want)
</a>
<br />
<a href={`${binaryName}-linux`}>{`${binaryName}`}-linux</a>
<a href={`${binaryName}-linux-arm64`}>
{`${binaryName}`}-linux ARM64
</a>
<br />
<a href={`${binaryName}-windows.exe`}>{`${binaryName}`}-windows</a>
</Card.Content>
Expand Down

0 comments on commit 42e6757

Please sign in to comment.