url-parser/.drone.yml

181 lines
3.5 KiB
YAML
Raw Normal View History

2020-02-03 00:05:18 +01:00
---
kind: pipeline
2020-09-21 20:24:51 +02:00
name: test
2020-02-03 00:05:18 +01:00
platform:
2021-09-12 21:50:32 +02:00
os: linux
arch: amd64
2020-02-03 00:05:18 +01:00
steps:
- name: staticcheck
image: golang:1.18
commands:
- go run honnef.co/go/tools/cmd/staticcheck ./...
volumes:
- name: gopath
path: /go
- name: lint
image: golang:1.18
commands:
- go run golang.org/x/lint/golint -set_exit_status ./...
volumes:
- name: gopath
path: /go
- name: vet
image: golang:1.18
commands:
- go vet ./...
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.18
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
volumes:
- name: gopath
path: /go
- name: coverage
image: plugins/codecov
settings:
files:
- coverage.txt
token:
from_secret: codecov_token
volumes:
2020-09-21 20:24:51 +02:00
- name: gopath
temp: {}
image_pull_secrets:
- docker_config
2020-02-03 00:05:18 +01:00
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
2020-02-03 00:05:18 +01:00
---
kind: pipeline
name: build-binaries
2020-02-03 00:05:18 +01:00
platform:
2021-09-12 21:50:32 +02:00
os: linux
arch: amd64
2020-02-03 00:05:18 +01:00
steps:
- name: build
image: techknowlogick/xgo:go-1.18.x
commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- mkdir -p release/
- cd cmd/url-parser && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm-7,linux/arm64' -out url-parser .
- mv /build/* /drone/src/release/
- ls -l /drone/src/release/
- name: executable
image: alpine
commands:
- $(find release/ -executable -type f | grep url-parser-linux-amd64) --help
- name: compress
image: alpine
commands:
- apk add upx
- find release/ -maxdepth 1 -executable -type f -exec upx {} \;
- ls -lh release/
- name: checksum
image: alpine
commands:
- cd release/ && sha256sum * > sha256sum.txt
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- release/*
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
image_pull_secrets:
- docker_config
2020-02-03 00:05:18 +01:00
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
2021-09-12 21:50:32 +02:00
depends_on:
- test
---
2020-02-03 00:05:18 +01:00
kind: pipeline
2020-09-21 20:24:51 +02:00
name: notifications
2020-02-03 00:05:18 +01:00
platform:
2021-09-12 21:50:32 +02:00
os: linux
arch: amd64
2020-02-03 00:05:18 +01:00
steps:
- name: matrix
image: thegeeklab/drone-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
2021-09-22 09:57:45 +02:00
template: "Status: **{{ build.Status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}<br/> Message: {{ commit.Message.Title }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
image_pull_secrets:
- docker_config
2020-02-03 00:05:18 +01:00
trigger:
ref:
- refs/heads/main
- refs/tags/**
2020-02-03 00:05:18 +01:00
status:
- success
- failure
depends_on:
- build-binaries
2020-02-03 00:05:18 +01:00
---
kind: signature
hmac: 09c7d46d1ca382b979a28ac23024bea55151074f05d9a61e03896e82145a6d04
2020-02-03 00:05:18 +01:00
...