Add cross-compile job

This commit is contained in:
Finn 2021-02-02 21:33:47 -08:00
parent 508af1e705
commit 6b57747ea2
2 changed files with 28 additions and 2 deletions

View file

@ -30,6 +30,30 @@ build:x86:
- signaldctl
expire_in: 1 month
build:cross-compile:
stage: build
image: golang:latest
before_script:
- mkdir -p /go/src/gitlab.com/signald/signald-go
- cp -r * /go/src/gitlab.com/signald/signald-go
- cd /go/src/gitlab.com/signald/signald-go
script:
- make signaldctl
- mv signaldctl "${CI_PROJECT_DIR}/signaldctl-${GOOS}-${GOARCH}"
artifacts:
paths:
- signaldctl-*
expire_in: 1 month
parallel:
matrix:
- GOOS: linux
GOARCH:
- arm
- arm64
- amd64
- GOOS: darwin
GOARCH: amd64
build:aarch64:
stage: build
tags: [arm-builder]

View file

@ -10,8 +10,10 @@ sudo apt install signaldctl
```
otherwise, download a binary from the CI:
* [x86_64](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl?job=build%3Ax86)
* [aarch64](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl?job=build%3Aaarch64)
* [Linux amd64](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl?job=build%3Ax86)
* [Linux arm](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl-linux-arm?job=build%3Across-compile)
* [Linux arm64](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl?job=build%3Aaarch64)
* [Mac amd64](https://gitlab.com/api/v4/projects/21018340/jobs/artifacts/main/raw/signaldctl-darwin-amd64?job=build%3Across-compile)
or build it yourself: