Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "build release" script #1

Open
dhermes opened this issue May 26, 2022 · 0 comments
Open

Add a "build release" script #1

dhermes opened this issue May 26, 2022 · 0 comments

Comments

@dhermes
Copy link
Member

dhermes commented May 26, 2022

This is what I did for the latest release. Fire up a "clean" build container with a volume to stash the built binaries:

mkdir release-builds
docker run \
  --rm \
  --interactive --tty \
  --volume $(pwd)/release-builds:/var/built \
  golang:1.18.2-alpine3.15

and then in the container install git and clone the repo

mkdir /var/code/
apk --update add git
git clone https://github.com/hardfinhq/npm-mod /var/code/npm-mod/

then to actually build in the container:

cd /var/code/npm-mod/
git checkout v1.20220526.1

CGO_ENABLED=0 GOOS=darwin  GOARCH=amd64 go build -ldflags="-s -w" -o /var/built/npm-mod-darwin-amd64-v1.20220526.1  ./cmd/npm-mod/
CGO_ENABLED=0 GOOS=darwin  GOARCH=arm64 go build -ldflags="-s -w" -o /var/built/npm-mod-darwin-arm64-v1.20220526.1  ./cmd/npm-mod/
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o /var/built/npm-mod-windows-amd64-v1.20220526.1 ./cmd/npm-mod/
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o /var/built/npm-mod-windows-arm64-v1.20220526.1 ./cmd/npm-mod/
CGO_ENABLED=0 GOOS=linux   GOARCH=amd64 go build -ldflags="-s -w" -o /var/built/npm-mod-linux-amd64-v1.20220526.1   ./cmd/npm-mod/
CGO_ENABLED=0 GOOS=linux   GOARCH=arm64 go build -ldflags="-s -w" -o /var/built/npm-mod-linux-arm64-v1.20220526.1   ./cmd/npm-mod/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant