26 lines
844 B
YAML
26 lines
844 B
YAML
stages:
|
|
- build
|
|
go_build:
|
|
stage: build
|
|
image: golang:1.12
|
|
variables:
|
|
CGO_ENABLED: 0
|
|
script:
|
|
- mkdir -p .cache/cache || true
|
|
- mkdir -p .cache/go || true
|
|
- export GOCACHE="$CI_PROJECT_DIR/.cache/cache"
|
|
- export GOPATH="$CI_PROJECT_DIR/.cache/go"
|
|
- CGO_ENABLED=1 go test -race ./...
|
|
- mkdir -p build || true
|
|
- go env
|
|
- GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-amd64 ./cmd/wg-quick
|
|
- GOOS=linux GOARCH=arm GOARM=7 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm32v7 ./cmd/wg-quick
|
|
- GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm64v8 ./cmd/wg-quick
|
|
artifacts:
|
|
paths:
|
|
- build/
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .cache
|