Skip to content

Commit 598df26

Browse files
committed
📦 Cross compile for windows and mac on release
1 parent 48c8197 commit 598df26

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.circleci/config.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,16 @@ jobs:
9898
at: .
9999
- run: go mod download
100100
- run: go test -mod=readonly .
101-
- run: "CGO_ENABLED=0 go build -mod=readonly -ldflags \"-extldflags \\\"-static\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_TAG -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -tags \"osusergo netgo nopackr\" -o marcel"
101+
- run: "CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=readonly -tags \"osusergo netgo nopackr\" -ldflags \"-extldflags \\\"-static\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_TAG -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -o marcel_linux_amd64"
102+
- run: "CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -mod=readonly -tags \"osusergo netgo nopackr\" -ldflags -H=windowsgui \"-extldflags \\\"-static\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_TAG -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -o marcel_windows_amd64.exe"
103+
- run: "CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -mod=readonly -tags \"nopackr\" -ldflags \"-s -extldflags \\\"-sectcreate __TEXT __info_plist Info.plist\\\" -X github.com/Zenika/marcel/version.Version=$CIRCLE_TAG -X github.com/Zenika/marcel/version.Revision=$CIRCLE_SHA1\" -o marcel_darwin_amd64"
102104
- persist_to_workspace:
103105
root: .
104106
paths:
105-
- Dockerfile
106-
- marcel
107+
- Docker
108+
- marcel_linux_amd64
109+
- marcel_windows_amd64.exe
110+
- marcel_darwin_amd64
107111

108112
docker_build_marcel:
109113
executor: std_executor
@@ -145,11 +149,15 @@ jobs:
145149
steps:
146150
- attach_workspace:
147151
at: .
148-
- run: tar czf marcel.tgz marcel
152+
- run: tar czf marcel_linux_amd64.tgz marcel_linux_amd64
153+
- run: tar czf marcel_windows_amd64.tgz marcel_windows_amd64.exe
154+
- run: tar czf marcel_darwin_amd64.tgz marcel_darwin_amd64
149155
- persist_to_workspace:
150156
root: .
151157
paths:
152-
- marcel.tgz
158+
- marcel_linux_amd64.tgz
159+
- marcel_windows_amd64.tgz
160+
- marcel_darwin_amd64.tgz
153161

154162
deploy_integration:
155163
executor: gcloud_executor
@@ -172,7 +180,7 @@ jobs:
172180
- attach_workspace:
173181
at: .
174182
- run: go get github.com/tcnksm/ghr
175-
- run: mkdir assets && mv backoffice/marcel-backoffice.tgz frontend/marcel-frontend.tgz marcel.tgz assets
183+
- run: mkdir assets && mv backoffice/marcel-backoffice.tgz frontend/marcel-frontend.tgz marcel_linux_amd64.tgz marcel_windows_amd64.tgz marcel_darwin_amd64.tgz assets
176184
- run: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} assets
177185

178186
filters-all: &filters-all

0 commit comments

Comments
 (0)