168 lines
2.8 KiB
YAML
168 lines
2.8 KiB
YAML
---
|
|
kind: pipeline
|
|
name: test
|
|
|
|
steps:
|
|
- name: test-code
|
|
image: golang
|
|
environment:
|
|
commands:
|
|
- go get
|
|
- go test
|
|
|
|
---
|
|
kind: pipeline
|
|
name: test-build
|
|
|
|
steps:
|
|
- name: prepare
|
|
image: golang
|
|
commands:
|
|
- go version
|
|
|
|
- name: build-linux-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o cmw-linux-amd64-${DRONE_COMMIT_SHA:0:8}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-darwin-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: darwin
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o cmw-darwin-amd64-${DRONE_COMMIT_SHA:0:8}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-windows-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o cmw-windows-amd64-${DRONE_COMMIT_SHA:0:8}.exe
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-linux-arm64
|
|
image: golang
|
|
environment:
|
|
GOOS: linux
|
|
GOARCH: arm64
|
|
commands:
|
|
- go get
|
|
- go build -o cmw-linux-arm64-${DRONE_COMMIT_SHA:0:8}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-darwin-arm64
|
|
image: golang
|
|
environment:
|
|
GOOS: darwin
|
|
GOARCH: arm64
|
|
commands:
|
|
- go get
|
|
- go build -o cmw-darwin-arm64-${DRONE_COMMIT_SHA:0:8}
|
|
depends_on:
|
|
- prepare
|
|
|
|
depends_on:
|
|
- test
|
|
|
|
---
|
|
kind: pipeline
|
|
name: build
|
|
|
|
steps:
|
|
- name: prepare
|
|
image: golang
|
|
commands:
|
|
- mkdir bin/
|
|
|
|
- name: build-linux-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o bin/cmw-linux-amd64-${DRONE_TAG}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-darwin-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: darwin
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o bin/cmw-darwin-amd64-${DRONE_TAG}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-windows-amd64
|
|
image: golang
|
|
environment:
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
commands:
|
|
- go get
|
|
- go build -o bin/cmw-windows-amd64-${DRONE_TAG}.exe
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-linux-arm64
|
|
image: golang
|
|
environment:
|
|
GOOS: linux
|
|
GOARCH: arm64
|
|
commands:
|
|
- go get
|
|
- go build -o bin/cmw-linux-arm64-${DRONE_TAG}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: build-darwin-arm64
|
|
image: golang
|
|
environment:
|
|
GOOS: darwin
|
|
GOARCH: arm64
|
|
commands:
|
|
- go get
|
|
- go build -o bin/cmw-darwin-arm64-${DRONE_TAG}
|
|
depends_on:
|
|
- prepare
|
|
|
|
- name: gitea_release
|
|
image: plugins/gitea-release
|
|
settings:
|
|
title: Release ${DRONE_TAG}
|
|
note: This is the cmw release of version ${DRONE_TAG}
|
|
api_key:
|
|
from_secret:
|
|
registry_password
|
|
base_url: https://scm.project42.io
|
|
files: bin/*
|
|
depends_on:
|
|
- build-linux-amd64
|
|
- build-darwin-amd64
|
|
- build-windows-amd64
|
|
- build-linux-arm64
|
|
- build-darwin-arm64
|
|
|
|
depends_on:
|
|
- test-build
|
|
|
|
trigger:
|
|
event:
|
|
- tag
|