Skip to content

Add a "build release" script #1

Open
@dhermes

Description

@dhermes

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions