1
0
forked from um/cli
cli/.drone.yml

258 lines
8.0 KiB
YAML
Raw Permalink Normal View History

2022-11-26 18:42:13 +00:00
---
kind: pipeline
name: build linux/amd64
steps:
- commands:
- git fetch --tags
image: alpine/git
name: fetch tags
- commands:
- go test -v ./...
2024-04-24 08:13:46 +00:00
environment:
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 18:42:13 +00:00
name: go test
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-linux-amd64-$(git describe --tags
--always).tar.gz"
2022-11-26 18:42:13 +00:00
environment:
GOARCH: amd64
GOOS: linux
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build linux/amd64
2022-11-26 18:42:13 +00:00
- commands:
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-linux-amd64-$(git
describe --tags --always).tar.gz" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-linux-amd64-$(git
describe --tags --always).tar.gz"
- sha256sum dist/um-linux-amd64-$(git describe --tags --always).tar.gz
2022-11-26 18:42:13 +00:00
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
environment:
DRONE_GITEA_SERVER: https://git.unlock-music.dev
GITEA_API_KEY:
from_secret: GITEA_API_KEY
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 18:42:13 +00:00
name: upload artifact
trigger:
event:
- push
- pull_request
type: docker
---
kind: pipeline
name: build windows/amd64
steps:
- commands:
- git fetch --tags
image: alpine/git
name: fetch tags
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
2024-10-20 21:04:54 +00:00
- command -v zip >/dev/null || (apt update && apt install -y zip)
- zip -9 -j -r "dist/um-windows-amd64-$(git describe --tags --always).zip" $DIST_DIR
2022-11-26 18:42:13 +00:00
environment:
GOARCH: amd64
GOOS: windows
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build windows/amd64
2022-11-26 18:42:13 +00:00
- commands:
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64-$(git
describe --tags --always).zip" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-windows-amd64-$(git
describe --tags --always).zip"
- sha256sum dist/um-windows-amd64-$(git describe --tags --always).zip
2022-11-26 18:42:13 +00:00
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
environment:
DRONE_GITEA_SERVER: https://git.unlock-music.dev
GITEA_API_KEY:
from_secret: GITEA_API_KEY
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 18:42:13 +00:00
name: upload artifact
trigger:
event:
- push
- pull_request
type: docker
---
kind: pipeline
name: build darwin/amd64
steps:
- commands:
- git fetch --tags
image: alpine/git
name: fetch tags
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-darwin-amd64-$(git describe --tags
--always).tar.gz"
2022-11-26 18:42:13 +00:00
environment:
GOARCH: amd64
GOOS: darwin
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build darwin/amd64
2022-11-26 18:42:13 +00:00
- commands:
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-darwin-amd64-$(git
describe --tags --always).tar.gz" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-darwin-amd64-$(git
describe --tags --always).tar.gz"
- sha256sum dist/um-darwin-amd64-$(git describe --tags --always).tar.gz
2022-11-26 18:42:13 +00:00
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
environment:
DRONE_GITEA_SERVER: https://git.unlock-music.dev
GITEA_API_KEY:
from_secret: GITEA_API_KEY
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 18:42:13 +00:00
name: upload artifact
trigger:
event:
- push
- pull_request
type: docker
2022-11-26 23:45:44 +00:00
---
kind: pipeline
name: release
steps:
- commands:
- git fetch --tags
image: alpine/git
name: fetch tags
- commands:
- go test -v ./...
2024-04-24 08:13:46 +00:00
environment:
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:45:44 +00:00
name: go test
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-linux-amd64-$(git describe --tags
--always).tar.gz"
2022-11-26 23:45:44 +00:00
environment:
GOARCH: amd64
GOOS: linux
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build linux/amd64
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-linux-arm64-$(git describe --tags
--always).tar.gz"
2022-11-26 23:45:44 +00:00
environment:
GOARCH: arm64
GOOS: linux
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build linux/arm64
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-linux-386-$(git describe --tags --always).tar.gz"
2022-11-26 23:45:44 +00:00
environment:
GOARCH: "386"
GOOS: linux
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build linux/386
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
2024-10-20 21:04:54 +00:00
- command -v zip >/dev/null || (apt update && apt install -y zip)
- zip -9 -j -r "dist/um-windows-amd64-$(git describe --tags --always).zip" $DIST_DIR
2022-11-26 23:45:44 +00:00
environment:
GOARCH: amd64
GOOS: windows
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build windows/amd64
2024-10-20 22:29:52 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
- mkdir -p dist
- command -v zip >/dev/null || (apt update && apt install -y zip)
- zip -9 -j -r "dist/um-windows-arm64-$(git describe --tags --always).zip" $DIST_DIR
2024-10-20 22:29:52 +00:00
environment:
GOARCH: arm64
GOOS: windows
GOPROXY: https://goproxy.io,direct
image: golang:1.22
name: go build windows/arm64
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
2024-10-20 21:04:54 +00:00
- command -v zip >/dev/null || (apt update && apt install -y zip)
- zip -9 -j -r "dist/um-windows-386-$(git describe --tags --always).zip" $DIST_DIR
2022-11-26 23:45:44 +00:00
environment:
GOARCH: "386"
GOOS: windows
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build windows/386
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-darwin-amd64-$(git describe --tags
--always).tar.gz"
2022-11-26 23:45:44 +00:00
environment:
GOARCH: amd64
GOOS: darwin
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build darwin/amd64
2022-11-26 23:45:44 +00:00
- commands:
- DIST_DIR=$(mktemp -d)
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
--always)" -o $DIST_DIR ./cmd/um
2022-11-26 23:50:04 +00:00
- mkdir -p dist
- tar -c -C $DIST_DIR um | gzip -9 > "dist/um-darwin-arm64-$(git describe --tags
--always).tar.gz"
2022-11-26 23:45:44 +00:00
environment:
GOARCH: arm64
GOOS: darwin
2024-04-24 09:11:40 +00:00
GOPROXY: https://goproxy.io,direct
2024-04-24 08:13:46 +00:00
image: golang:1.22
2022-11-26 23:47:42 +00:00
name: go build darwin/arm64
- commands:
- mv dist/*.tar.gz dist/*.zip ./
image: golang:1.22
name: prepare root
2022-11-26 23:45:44 +00:00
- image: plugins/gitea-release
name: create release
settings:
api_key:
from_secret: GITEA_API_KEY
base_url: https://git.unlock-music.dev
checksum: sha256
draft: true
files:
- um-*.tar.gz
- um-*.zip
2022-11-26 23:45:44 +00:00
title: ${DRONE_TAG}
trigger:
event:
- tag
type: docker