2023-07-02 19:01:44 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: test
|
|
|
|
|
|
|
|
steps:
|
2023-07-02 19:13:09 +00:00
|
|
|
- name: test-code
|
2023-07-02 19:01:44 +00:00
|
|
|
image: golang
|
|
|
|
commands:
|
2023-07-02 20:12:14 +00:00
|
|
|
- go get
|
|
|
|
- go test
|
2023-07-02 19:01:44 +00:00
|
|
|
|
2023-07-02 20:12:14 +00:00
|
|
|
- name: run-code
|
|
|
|
image: golang
|
|
|
|
commands:
|
|
|
|
- go get
|
|
|
|
- go run .
|
2023-07-02 19:13:09 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-07-02 19:37:43 +00:00
|
|
|
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
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o cmw-linux-amd64-${DRONE_COMMIT_SHA:0:8}
|
2023-07-02 19:37:43 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
- name: build-darwin-amd64
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: amd64
|
|
|
|
commands:
|
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o cmw-darwin-amd64-${DRONE_COMMIT_SHA:0:8}
|
2023-07-02 19:37:43 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
- name: build-windows-amd64
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
|
|
|
commands:
|
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o cmw-windows-amd64-${DRONE_COMMIT_SHA:0:8}.exe
|
2023-07-02 19:37:43 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
- name: build-linux-arm64
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: arm64
|
|
|
|
commands:
|
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o cmw-linux-arm64-${DRONE_COMMIT_SHA:0:8}
|
2023-07-02 19:37:43 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
- name: build-darwin-arm64
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: arm64
|
|
|
|
commands:
|
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o cmw-darwin-arm64-${DRONE_COMMIT_SHA:0:8}
|
2023-07-02 19:37:43 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- test
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-07-02 19:13:09 +00:00
|
|
|
name: build
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: prepare
|
|
|
|
image: golang
|
|
|
|
commands:
|
|
|
|
- mkdir bin/
|
|
|
|
|
|
|
|
- name: build-linux-amd64
|
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
|
|
|
commands:
|
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o bin/cmw-linux-amd64-${DRONE_TAG}
|
2023-07-02 19:27:25 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
2023-07-02 19:13:09 +00:00
|
|
|
|
|
|
|
- name: build-darwin-amd64
|
2023-07-02 19:01:44 +00:00
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: amd64
|
|
|
|
commands:
|
2023-07-02 19:13:09 +00:00
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o bin/cmw-darwin-amd64-${DRONE_TAG}
|
2023-07-02 19:27:25 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
2023-07-02 19:01:44 +00:00
|
|
|
|
2023-07-02 19:13:09 +00:00
|
|
|
- name: build-windows-amd64
|
2023-07-02 19:01:44 +00:00
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
|
|
|
commands:
|
2023-07-02 19:13:09 +00:00
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o bin/cmw-windows-amd64-${DRONE_TAG}.exe
|
2023-07-02 19:27:25 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
2023-07-02 19:01:44 +00:00
|
|
|
|
2023-07-02 19:13:09 +00:00
|
|
|
- name: build-linux-arm64
|
2023-07-02 19:01:44 +00:00
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: arm64
|
|
|
|
commands:
|
2023-07-02 19:13:09 +00:00
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o bin/cmw-linux-arm64-${DRONE_TAG}
|
2023-07-02 19:27:25 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
2023-07-02 19:01:44 +00:00
|
|
|
|
2023-07-02 19:13:09 +00:00
|
|
|
- name: build-darwin-arm64
|
2023-07-02 19:01:44 +00:00
|
|
|
image: golang
|
|
|
|
environment:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: arm64
|
|
|
|
commands:
|
2023-07-02 19:13:09 +00:00
|
|
|
- go get
|
2023-07-02 19:45:22 +00:00
|
|
|
- go build -o bin/cmw-darwin-arm64-${DRONE_TAG}
|
2023-07-02 19:27:25 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare
|
2023-07-02 19:13:09 +00:00
|
|
|
|
2023-07-02 20:12:14 +00:00
|
|
|
- name: generate-checksum
|
|
|
|
image: golang
|
|
|
|
commands:
|
|
|
|
- cd bin
|
|
|
|
- md5sum * > ../md5sums.txt
|
|
|
|
- sha512sum * > ../sha512sums.txt
|
|
|
|
- cp ../md5sums.txt .
|
|
|
|
- cp ../sha512sums.txt .
|
|
|
|
depends_on:
|
|
|
|
- build-linux-amd64
|
|
|
|
- build-darwin-amd64
|
|
|
|
- build-windows-amd64
|
|
|
|
- build-linux-arm64
|
|
|
|
- build-darwin-arm64
|
|
|
|
|
2023-07-02 19:27:25 +00:00
|
|
|
- name: gitea_release
|
|
|
|
image: plugins/gitea-release
|
|
|
|
settings:
|
2023-07-02 19:45:22 +00:00
|
|
|
title: Release ${DRONE_TAG}
|
|
|
|
note: This is the cmw release of version ${DRONE_TAG}
|
2023-07-02 19:27:25 +00:00
|
|
|
api_key:
|
|
|
|
from_secret:
|
2023-07-02 19:50:02 +00:00
|
|
|
gitea_release
|
2023-07-02 19:27:25 +00:00
|
|
|
base_url: https://scm.project42.io
|
|
|
|
files: bin/*
|
|
|
|
depends_on:
|
2023-07-02 20:12:14 +00:00
|
|
|
- generate-checksum
|
2023-07-02 19:15:27 +00:00
|
|
|
|
|
|
|
depends_on:
|
2023-07-02 19:37:43 +00:00
|
|
|
- test-build
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- tag
|