Skip to content

Commit

Permalink
make target for static-release-win
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter committed Jan 27, 2025
1 parent 9765f62 commit 2848a37
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packaging.make
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,30 @@ static-release: server-static-compressed
--version ${BUILD_CHANNEL} \
--arch ${UNAME_M} \
--output-path etc/packaging/static/manifest/viam-server-${BUILD_CHANNEL}-${UNAME_M}.json

static-release-win: FILENAME_OS=-windows
static-release-win:
# note: FILENAME_OS will be -windows for windows builds; for backwards compatibility, we don't do this for linux.
rm -f bin/static/viam-server-windows.exe
GOOS=windows GOARCH=amd64 go build -tags no_cgo,osusergo,netgo -ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/static/viam-server-windows.exe ./web/cmd/server
upx --best --lzma bin/static/viam-server-windows.exe

rm -rf etc/packaging/static/deploy/
mkdir -p etc/packaging/static/deploy/
cp bin/static/viam-server-windows.exe etc/packaging/static/deploy/viam-server$(FILENAME_OS)-${BUILD_CHANNEL}-${UNAME_M}.exe
if [ "${RELEASE_TYPE}" = "stable" ] || [ "${RELEASE_TYPE}" = "latest" ]; then \
cp bin/static/viam-server-windows.exe etc/packaging/static/deploy/viam-server$(FILENAME_OS)-${RELEASE_TYPE}-${UNAME_M}.exe; \
fi

# note: GOOS=windows would break this on a linux runner
go run -tags no_cgo ./web/cmd/server --dump-resources win-resources.json

rm -rf etc/packaging/static/manifest/
mkdir -p etc/packaging/static/manifest/
go run ./etc/subsystem_manifest \
--binary-path etc/packaging/static/deploy/viam-server$(FILENAME_OS)-${BUILD_CHANNEL}-${UNAME_M}.exe \
--upload-path packages.viam.com/apps/viam-server/viam-server$(FILENAME_OS)-${BUILD_CHANNEL}-${UNAME_M}.exe \
--version ${BUILD_CHANNEL} \
--arch ${UNAME_M} \
--resources-json win-resources.json \
--output-path etc/packaging/static/manifest/viam-server$(FILENAME_OS)-${BUILD_CHANNEL}-${UNAME_M}.json

0 comments on commit 2848a37

Please sign in to comment.