Skip to content

Commit b835c67

Browse files
authored
Added goreleaser to build m1 binaries (#178)
* Added goreleaser * Updated build yaml for m1 * Testing the make build * Added job name * Added github token for goreleaser * Updated build pipeline * Added build osx yml * Test publish osx binaries * Testing * Updated brew.tpl * Commented publish osx * Updated goreleaser * Updated azure yaml * Added windows release * Test local linux binaries * Updated iofogctl test binaries * test release * Updated .gitignore file * Test goreleaser release * Updated azure pipeline Publish stage * Updated the lgflags value in goreleaser * Updated goos and goarch ldflags value * Added package cloud token * Test packagecloud push * packagcloud push working * Updated node version * Updated vm distro * Updated pipeline * Updated nvm version * Updated vanilla image * Removed vanilla tests * uncommented vanilla tests * Test vanilla * Test * install npm 8.19.4 * Updated tests * updated npm config * Updated controller package to a scoped package * TEst * Updated packagecloud repo install script * Updated install iofog controller script * Updated nvm install script * Fix tests * Updated operator image to test k8s deployment * Removed unwanted files * cleanup * Added hooks * Added rice-box file * Removed commented code
1 parent 4674dc1 commit b835c67

26 files changed

+860
-246
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ reports/*
66
test.txt
77
test-report.xml
88

9-
*rice-box.go
10-
.vscode/*
9+
.vscode/*
10+
dist/
11+
vendor/
12+
bats-core/
13+
.DS_Store

.goreleaser-iofogctl-dev.yml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# goreleaser config for iofogctl. See: https://goreleaser.com
2+
#
3+
# To execute goreleaser, use the mage targets:
4+
#
5+
# $ mage iofogctl:snapshot
6+
# $ mage iofogctl:release
7+
#
8+
# The snapshot target builds the installation packages (brew, rpm,
9+
# deb, etc), into the dist dir.
10+
# The release target does the same, but also publishes the packages.
11+
#
12+
# See README.md for more.
13+
project_name: iofogctl
14+
env:
15+
- GO111MODULE=on
16+
- CGO_ENABLED=0
17+
before:
18+
hooks:
19+
- go version
20+
21+
builds:
22+
- id: build_macos
23+
binary: iofogctl
24+
env:
25+
main: ./cmd/iofogctl/main.go
26+
goos:
27+
- darwin
28+
goarch:
29+
- amd64
30+
- arm64
31+
ldflags:
32+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.versionNumber=v{{.Version}}"
33+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.commit={{ .ShortCommit }}"
34+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.date={{.Date}}"
35+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.platform={{.Os}}/{{.Arch }}"
36+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.portManagerTag=3.0.0"
37+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.kubeletTag=3.0.0-beta1"
38+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.operatorTag=3.0.1"
39+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.proxyTag=3.0.0"
40+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.routerTag=3.0.0"
41+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerTag=3.0.1"
42+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentTag=3.0.1"
43+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerVersion=3.0.1"
44+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentVersion=3.0.1"
45+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.repo=iofog"
46+
47+
- id: build_linux
48+
binary: iofogctl
49+
main: ./cmd/iofogctl/
50+
goos:
51+
- linux
52+
goarch:
53+
- amd64
54+
- arm64
55+
- arm
56+
goarm:
57+
- 6
58+
- 7
59+
ldflags:
60+
- -extldflags -static
61+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.versionNumber=v{{.Version}}"
62+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.commit={{ .ShortCommit }}"
63+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.date={{.Date}}"
64+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.platform={{.Os}}/{{.Arch }}"
65+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.portManagerTag=3.0.0"
66+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.kubeletTag=3.0.0-beta1"
67+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.operatorTag=3.0.1"
68+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.proxyTag=3.0.0"
69+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.routerTag=3.0.0"
70+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerTag=3.0.1"
71+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentTag=3.0.1"
72+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerVersion=3.0.1"
73+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentVersion=3.0.1"
74+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.repo=iofog"
75+
flags:
76+
- -v
77+
78+
- id: build_windows
79+
binary: iofogctl
80+
env:
81+
main: ./cmd/iofogctl/main.go
82+
goos:
83+
- windows
84+
goarch:
85+
- amd64
86+
ldflags:
87+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.versionNumber=v{{.Version}}"
88+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.commit={{ .ShortCommit }}"
89+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.date={{.Date}}"
90+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.platform={{.Os}}/{{.Arch }}"
91+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.portManagerTag=3.0.0"
92+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.kubeletTag=3.0.0-beta1"
93+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.operatorTag=3.0.1"
94+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.proxyTag=3.0.0"
95+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.routerTag=3.0.0"
96+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerTag=3.0.1"
97+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentTag=3.0.1"
98+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.controllerVersion=3.0.1"
99+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.agentVersion=3.0.1"
100+
- -s -w -X "github.com/eclipse-iofog/iofogctl/v3/pkg/util.repo=iofog"
101+
102+
103+
archives:
104+
-
105+
id: linux
106+
builds:
107+
- build_linux
108+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
109+
format: tar.gz
110+
files:
111+
- README.md
112+
- LICENSE
113+
-
114+
id: macos
115+
builds:
116+
- build_macos
117+
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}_{{.Arch}}"
118+
format: tar.gz
119+
files:
120+
- README.md
121+
- LICENSE
122+
replacements:
123+
darwin: macos
124+
125+
checksum:
126+
name_template: "{{.ProjectName}}-checksums.txt"
127+
128+
snapshot:
129+
name_template: "{{ .Version }}~dev"
130+
131+
changelog:
132+
skip: true
133+
sort: asc
134+
filters:
135+
exclude:
136+
- '^docs:'
137+
- '^test:'
138+
- '^dev:'
139+
- 'README'
140+
- Merge pull request
141+
- Merge branch
142+
143+
144+
release:
145+
github:
146+
owner: eclipse-iofog
147+
name: iofogctl
148+
149+
# If set to true, will not auto-publish the release. Default is false.
150+
draft: false
151+
152+
# If set to auto, will mark the release as not ready for production
153+
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
154+
# If set to true, will mark the release as not ready for production.
155+
# Default is false.
156+
prerelease: auto
157+
158+
brews:
159+
-
160+
name: iofogctl
161+
homepage: "https://github.com/eclipse-iofog/iofogctl"
162+
description: "CLI for iofog"
163+
164+
tap:
165+
owner: eclipse-iofog
166+
name: homebrew-iofogctl
167+
168+
url_template: "https://github.com/eclipse-iofog/iofogctl/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
169+
170+
commit_author:
171+
name: neha
172+
173+
174+
folder: Formula
175+
176+
test: |
177+
system "#{bin}/iofogctl version"
178+
install: |
179+
bin.install "iofogctl"
180+
skip_upload: false
181+
182+
nfpms:
183+
-
184+
builds: ['build_linux']
185+
homepage: "https://github.com/eclipse-iofog/iofogctl"
186+
description: CLI for iofog
187+
maintainer: Eclipse
188+
vendor: Edgeworx
189+
190+
191+
formats:
192+
- deb
193+
- rpm
194+
195+
overrides:
196+
deb:
197+
file_name_template: "{{ .ConventionalFileName }}"
198+
rpm:
199+
# Note: file_name_template must have this EXACT format
200+
file_name_template: "{{ .ProjectName }}-{{ .Version }}-1.{{ .Arch }}{{ if .Arm }}v{{ .Arm }}hl{{ end }}"
201+
replacements:
202+
amd64: x86_64
203+
arm64: aarch64

0 commit comments

Comments
 (0)