Skip to content

Commit 73a21bb

Browse files
authored
m1 support (#164)
1 parent 2c9c1cd commit 73a21bb

27 files changed

Lines changed: 111 additions & 663 deletions

File tree

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.2.1

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Go
4141
uses: actions/setup-go@master
4242
with:
43-
go-version: 1.14
43+
go-version: 1.17.2
4444
- name: dry run goreleaser
4545
uses: goreleaser/goreleaser-action@master
4646
env:

.github/workflows/release-publisher.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up Go
1212
uses: actions/setup-go@master
1313
with:
14-
go-version: 1.14
14+
go-version: 1.17.2
1515
- name: Install bazelisk
1616
run: |
1717
sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/bazelisk-linux-amd64

.goreleaser.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ project_name: deleterious
33
builds:
44
-
55
main: dummy.go
6-
goos:
7-
- linux
8-
- darwin
9-
- windows
10-
goarch:
11-
- amd64
6+
targets:
7+
- linux_amd64
8+
- darwin_amd64
9+
- darwin_arm64
10+
- windows_amd64
1211
binary: deleterious
1312
hooks:
1413
post: ./goreleaser-post-hook.sh

BUILD.bazel

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ go_library(
2121
go_binary(
2222
name = "deleterious-linux",
2323
embed = [":go_default_library"],
24-
goos = "linux",
2524
goarch = "amd64",
25+
goos = "linux",
2626
visibility = ["//visibility:public"],
2727
x_defs = {
2828
"version": VERSION,
@@ -32,8 +32,19 @@ go_binary(
3232
go_binary(
3333
name = "deleterious-darwin",
3434
embed = [":go_default_library"],
35+
goarch = "amd64",
3536
goos = "darwin",
37+
visibility = ["//visibility:public"],
38+
x_defs = {
39+
"version": VERSION,
40+
},
41+
)
42+
43+
go_binary(
44+
name = "deleterious-darwin-m1",
45+
embed = [":go_default_library"],
3646
goarch = "amd64",
47+
goos = "darwin",
3748
visibility = ["//visibility:public"],
3849
x_defs = {
3950
"version": VERSION,
@@ -43,8 +54,8 @@ go_binary(
4354
go_binary(
4455
name = "deleterious-windows",
4556
embed = [":go_default_library"],
46-
goos = "windows",
4757
goarch = "amd64",
58+
goos = "windows",
4859
visibility = ["//visibility:public"],
4960
x_defs = {
5061
"version": VERSION,
@@ -55,6 +66,7 @@ pkg_tar(
5566
name = "bdist",
5667
srcs = [
5768
"//:deleterious-darwin",
69+
"//:deleterious-darwin-m1",
5870
"//:deleterious-linux",
5971
"//:deleterious-windows",
6072
],
@@ -81,6 +93,9 @@ go_test(
8193
"@io_bazel_rules_go//go/platform:darwin_amd64": [
8294
"$(location :deleterious-darwin)",
8395
],
96+
"@io_bazel_rules_go//go/platform:darwin_arm64": [
97+
"$(location :deleterious-darwin-m1)",
98+
],
8499
"//conditions:default": [],
85100
}),
86101
data = select({
@@ -90,6 +105,9 @@ go_test(
90105
"@io_bazel_rules_go//go/platform:darwin_amd64": [
91106
":deleterious-darwin",
92107
],
108+
"@io_bazel_rules_go//go/platform:darwin_arm64": [
109+
":deleterious-darwin-m1",
110+
],
93111
"//conditions:default": [],
94112
}),
95113
embed = [":go_default_library"],

WORKSPACE

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,33 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1313
# will tell us about new releases of rules_go
1414
http_archive(
1515
name = "io_bazel_rules_go",
16-
sha256 = "87f0fb9747854cb76a0a82430adccb6269f7d394237104a4523b51061c469171",
16+
sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
1717
urls = [
18-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.1/rules_go-v0.23.1.tar.gz",
19-
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.1/rules_go-v0.23.1.tar.gz",
18+
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
19+
"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
2020
],
2121
)
2222

2323
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
2424

2525
go_rules_dependencies()
2626

27-
go_register_toolchains(
28-
go_version = "1.14",
29-
)
27+
go_register_toolchains(version = "1.17.1")
3028

31-
# to easily generate the http_archive with sha use a command like
32-
# bzl use bazelbuild/bazel-gazelle 0.18.2
3329
http_archive(
3430
name = "bazel_gazelle",
35-
sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10",
31+
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
3632
urls = [
37-
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
38-
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
33+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
34+
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
3935
],
4036
)
4137

4238
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
4339

4440
gazelle_dependencies()
4541

46-
buildtools_version = "0.28.0"
42+
buildtools_version = "4.2.3"
4743

4844
http_archive(
4945
name = "io_bazel_buildtools",

go.mod

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kindlyops/deleterious
22

3-
go 1.12
3+
go 1.17
44

55
require (
66
github.com/aws/aws-sdk-go v1.30.7
@@ -10,3 +10,22 @@ require (
1010
github.com/spf13/cobra v0.0.7
1111
github.com/spf13/viper v1.7.0
1212
)
13+
14+
require (
15+
github.com/fsnotify/fsnotify v1.4.7 // indirect
16+
github.com/hashicorp/hcl v1.0.0 // indirect
17+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
18+
github.com/jmespath/go-jmespath v0.3.0 // indirect
19+
github.com/magiconair/properties v1.8.1 // indirect
20+
github.com/mitchellh/mapstructure v1.1.2 // indirect
21+
github.com/pelletier/go-toml v1.2.0 // indirect
22+
github.com/spf13/afero v1.1.2 // indirect
23+
github.com/spf13/cast v1.3.0 // indirect
24+
github.com/spf13/jwalterweatherman v1.0.0 // indirect
25+
github.com/spf13/pflag v1.0.3 // indirect
26+
github.com/subosito/gotenv v1.2.0 // indirect
27+
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect
28+
golang.org/x/text v0.3.2 // indirect
29+
gopkg.in/ini.v1 v1.51.0 // indirect
30+
gopkg.in/yaml.v2 v2.2.4 // indirect
31+
)

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
121121
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
122122
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
123123
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
124-
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
125124
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
126125
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
127126
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
@@ -189,7 +188,6 @@ github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=
189188
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
190189
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
191190
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
192-
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
193191
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
194192
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
195193
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
@@ -241,7 +239,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
241239
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
242240
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
243241
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
244-
golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco=
245242
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
246243
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
247244
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -261,7 +258,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
261258
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
262259
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
263260
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
264-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
265261
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
266262
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
267263
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -270,7 +266,6 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
270266
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
271267
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc=
272268
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
273-
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
274269
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
275270
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
276271
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
@@ -327,7 +322,6 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
327322
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
328323
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
329324
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
330-
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
331325
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
332326
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
333327
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

goreleaser-post-hook.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ set -eo pipefail
33

44
echo "moving bazel outputs to goreleaser dist directory for packaging..."
55
mkdir -p dist/deleterious_darwin_amd64
6+
mkdir -p dist/deleterious_darwin_arm64
67
mkdir -p dist/deleterious_linux_amd64
78
mkdir -p dist/deleterious_windows_amd64
89

910
sudo cp bdist/deleterious-darwin dist/deleterious_darwin_amd64/deleterious
11+
sudo cp bdist/deleterious-darwin-m1 dist/deleterious_darwin_arm64/deleterious
1012
sudo cp bdist/deleterious-linux dist/deleterious_linux_amd64/deleterious
1113
sudo cp bdist/deleterious-windows.exe dist/deleterious_windows_amd64/deleterious.exe
12-

vendor/github.com/hashicorp/hcl/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)