Skip to content

Commit dca923a

Browse files
committed
Add support for a Darwin M1 binary
* Update get.sh to download the specific darwin arm64 package for M1 * Build an M1 binary * Print the build of the binary in the version command * Update CI to Go 1.17 to support M1 builds Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 5b7b7bb commit dca923a

File tree

9 files changed

+648
-78
lines changed

9 files changed

+648
-78
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
strategy:
1414
matrix:
15-
go-version: [1.16.x]
15+
go-version: [1.17.x]
1616
os: [ubuntu-latest]
1717
runs-on: ${{ matrix.os }}
1818
steps:

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
build:
1010
strategy:
1111
matrix:
12-
go-version: [1.16.x]
12+
go-version: [1.17.x]
1313
os: [ubuntu-latest]
1414
runs-on: ${{ matrix.os }}
1515
steps:

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dist:
2828
rm -rf bin/inlets*
2929
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl
3030
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-darwin
31+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-darwin-arm64
3132
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl.exe
3233
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-armhf
3334
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-arm64

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ type Provisioner interface {
110110
}
111111
```
112112

113-
### Community support
113+
### License
114114

115-
You can seek out community support through the [OpenFaaS Slack](https://slack.openfaas.io/) in the `#inlets` channel
115+
inletsctl is distributed under the MIT license. inlets-pro, which inletsctl uses is licensed under the [inlets-pro End User License Agreement (EULA)](https://github.com/inlets/inlets-pro/blob/master/EULA.md).
116116

117-
### License
117+
A valid inlets license or Gumroad subscription is required to create tunnel servers with inletsctl.
118118

119-
MIT

ci/compress.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/sh
2+
23
cd bin
3-
for f in inletsctl*; do tar -cvzf ../uploads/$f.tgz $f; done
4+
for f in inletsctl*; do tar -cvzf ../uploads/$f.tgz $f; done

cmd/inletsctl.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package cmd
66
import (
77
"fmt"
88
"os"
9+
"runtime"
910

1011
"github.com/morikuni/aec"
1112
"github.com/spf13/cobra"
@@ -57,8 +58,10 @@ func getVersion() string {
5758
func parseBaseCommand(_ *cobra.Command, _ []string) {
5859
printLogo()
5960

60-
fmt.Println("Version:", getVersion())
61-
fmt.Println("Git Commit:", GitCommit)
61+
fmt.Printf("Version: %s\n", getVersion())
62+
fmt.Printf("Git Commit: %s\n", GitCommit)
63+
fmt.Printf("Build target: %s/%s\n", runtime.GOOS, runtime.GOARCH)
64+
6265
os.Exit(0)
6366
}
6467

get.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,21 @@ hasCli() {
3030
getPackage() {
3131
uname=$(uname)
3232
userid=$(id -u)
33+
arch=$(uname -m)
3334

3435
suffix=""
3536
case $uname in
3637
"Darwin")
37-
suffix="-darwin.tgz"
38+
case $arch in
39+
"x86_64")
40+
suffix="-darwin.tgz"
41+
;;
42+
esac
43+
case $arch in
44+
"arm64")
45+
suffix="-darwin-arm64.tgz"
46+
;;
47+
esac
3848
;;
3949
"Linux")
4050
arch=$(uname -m)

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module github.com/inlets/inletsctl
22

3-
go 1.13
3+
go 1.16
44

55
require (
6-
github.com/alexellis/go-execute v0.0.0-20191029181357-d17947259f74
7-
github.com/golang/mock v1.3.1
8-
github.com/inlets/cloud-provision v0.5.3
6+
github.com/alexellis/go-execute v0.5.0
7+
github.com/golang/mock v1.6.0
8+
github.com/inlets/cloud-provision v0.5.5
99
github.com/linode/linodego v0.19.0
1010
github.com/morikuni/aec v1.0.0
1111
github.com/pkg/errors v0.9.1
1212
github.com/sethvargo/go-password v0.2.0
13-
github.com/spf13/cobra v0.0.5
13+
github.com/spf13/cobra v1.3.0
1414
github.com/spf13/pflag v1.0.5
1515

1616
)

go.sum

Lines changed: 619 additions & 63 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)