Skip to content

Commit

Permalink
build and package multi-arch artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrokethecloud committed Jun 24, 2024
1 parent c42b6d3 commit cdbb05c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ cd $(dirname $0)/..

mkdir -p bin
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s"
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/docker-machine-driver-harvester
GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/docker-machine-driver-harvester-amd64
GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/docker-machine-driver-harvester-arm64
8 changes: 7 additions & 1 deletion scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ source $(dirname $0)/version
cd $(dirname $0)/..

mkdir -p dist/artifacts
tar -zcvf dist/artifacts/docker-machine-driver-harvester${SUFFIX}.tar.gz -C bin docker-machine-driver-harvester

for arch in amd64 arm64
do
cp bin/docker-machine-driver-harvester-${arch} bin/docker-machine-driver-harvester
tar -zcvf dist/artifacts/docker-machine-driver-harvester-${arch}.tar.gz -C bin docker-machine-driver-harvester
done
rm bin/docker-machine-driver-harvester

0 comments on commit cdbb05c

Please sign in to comment.