mirror of
https://github.com/thegeeklab/url-parser.git
synced 2024-11-14 17:20:41 +00:00
118 lines
2.0 KiB
YAML
118 lines
2.0 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: testing
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
steps:
|
|
- name: vet
|
|
image: golang:1.12
|
|
commands:
|
|
- go vet ./...
|
|
|
|
- name: test
|
|
image: golang:1.12
|
|
commands:
|
|
- go test -cover ./...
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/master
|
|
- refs/tags/**
|
|
- refs/pull/**
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: build-binaries
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
steps:
|
|
- name: build
|
|
image: techknowlogick/xgo:latest
|
|
commands:
|
|
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
|
|
- mkdir -p release/
|
|
- ls -lh
|
|
- xgo -ldflags "-X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out url-parser-$BUILD_VERSION ./cmd/url-parser
|
|
- cp /build/* release/
|
|
|
|
- name: executable
|
|
image: golang:1.12
|
|
commands:
|
|
- $(find release/ -executable -type f | grep url-parser-*-linux-amd64) --help
|
|
|
|
- name: checksum
|
|
image: alpine
|
|
commands:
|
|
- cd release/ && sha256sum * > sha256sum.txt
|
|
|
|
- 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/**
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/master
|
|
- refs/tags/**
|
|
- refs/pull/**
|
|
|
|
depends_on:
|
|
- testing
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: notification
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
steps:
|
|
- name: matrix
|
|
image: plugins/matrix
|
|
settings:
|
|
homeserver:
|
|
from_secret: matrix_homeserver
|
|
password:
|
|
from_secret: matrix_password
|
|
roomid:
|
|
from_secret: matrix_roomid
|
|
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
|
username:
|
|
from_secret: matrix_username
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/heads/master
|
|
- refs/tags/**
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
depends_on:
|
|
- build-binaries
|
|
|
|
---
|
|
kind: signature
|
|
hmac: 09c4c7b333827ec19925d9d33aae7c014f9dbfc8b35f2078419de0ba0a30c19a
|
|
|
|
...
|