0
0
mirror of https://github.com/thegeeklab/github-releases-notifier.git synced 2024-06-02 17:49:40 +02:00
github-releases-notifier/.drone.yml

359 lines
6.7 KiB
YAML
Raw Normal View History

---
kind: pipeline
type: docker
name: testing
platform:
os: linux
arch: amd64
steps:
- name: vet
image: golang:1.12
commands:
- go vet ./...
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.12
commands:
- go test -cover ./...
volumes:
- name: gopath
path: /go
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
---
kind: pipeline
type: docker
2020-01-14 15:08:20 +01:00
name: build-container-amd64
platform:
os: linux
arch: amd64
steps:
2020-01-15 10:00:03 +01:00
- name: build
image: golang:1.12
commands:
2020-01-15 10:00:03 +01:00
- "[ -z \"${BUILD_VERSION}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8}"
- go build -v -ldflags "-X main.Version=$BUILD_VERSION" -a -tags netgo -o release/amd64/github-releases-notifier
environment:
2020-01-15 10:00:03 +01:00
BUILD_VERSION: ${DRONE_TAG##v}
CGO_ENABLED: 0
- name: executable
image: golang:1.12
commands:
2020-01-14 15:08:20 +01:00
- ./release/amd64/github-releases-notifier --help
2020-01-15 10:00:03 +01:00
- ./release/amd64/github-releases-notifier --version
- name: dryrun
image: plugins/docker
settings:
2020-01-14 15:08:20 +01:00
dockerfile: docker/Dockerfile.amd64
dry_run: true
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
2020-01-14 15:08:20 +01:00
tags: amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
image: plugins/docker
settings:
auto_tag: true
2020-01-14 15:08:20 +01:00
auto_tag_suffix: amd64
dockerfile: docker/Dockerfile.amd64
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
2020-01-14 15:08:20 +01:00
name: build-container-arm64
platform:
os: linux
arch: arm64
steps:
2020-01-15 10:00:03 +01:00
- name: build
image: golang:1.12
commands:
2020-01-15 10:00:03 +01:00
- "[ -z \"${BUILD_VERSION}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8}"
- go build -v -ldflags "-X main.Version=$BUILD_VERSION" -a -tags netgo -o release/arm64/github-releases-notifier
environment:
2020-01-15 10:00:03 +01:00
BUILD_VERSION: ${DRONE_TAG##v}
CGO_ENABLED: 0
- name: executable
image: golang:1.12
commands:
2020-01-14 15:08:20 +01:00
- ./release/arm64/github-releases-notifier --help
2020-01-15 10:00:03 +01:00
- ./release/arm64/github-releases-notifier --version
- name: dryrun
image: plugins/docker
settings:
2020-01-14 15:08:20 +01:00
dockerfile: docker/Dockerfile.arm64
dry_run: true
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
2020-01-14 15:08:20 +01:00
tags: arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
image: plugins/docker
settings:
auto_tag: true
2020-01-14 15:08:20 +01:00
auto_tag_suffix: arm64
dockerfile: docker/Dockerfile.arm64
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
2020-01-14 15:08:20 +01:00
name: build-container-arm
platform:
os: linux
arch: arm
steps:
2020-01-15 10:00:03 +01:00
- name: build
image: golang:1.12
commands:
2020-01-15 10:00:03 +01:00
- "[ -z \"${BUILD_VERSION}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8}"
- go build -v -ldflags "-X main.Version=$BUILD_VERSION" -a -tags netgo -o release/arm/github-releases-notifier
environment:
2020-01-15 10:00:03 +01:00
BUILD_VERSION: ${DRONE_TAG##v}
CGO_ENABLED: 0
- name: executable
image: golang:1.12
commands:
2020-01-14 15:08:20 +01:00
- ./release/arm/github-releases-notifier --help
2020-01-15 10:00:03 +01:00
- ./release/arm/github-releases-notifier --version
- name: dryrun
image: plugins/docker
settings:
2020-01-14 15:08:20 +01:00
dockerfile: docker/Dockerfile.arm
dry_run: true
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
2020-01-14 15:08:20 +01:00
tags: arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
image: plugins/docker
settings:
auto_tag: true
2020-01-14 15:08:20 +01:00
auto_tag_suffix: arm
dockerfile: docker/Dockerfile.arm
password:
from_secret: docker_password
repo: xoxys/github-releases-notifier
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
2020-01-15 10:00:03 +01:00
---
kind: pipeline
type: docker
name: build-binaries
platform:
os: linux
arch: amd64
steps:
- name: build
image: techknowlogick/xgo:latest
commands:
- "[ -z \"${BUILD_VERSION}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8}"
- mkdir -p release/
- xgo -ldflags "-X main.Version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out github-releases-notifier-$BUILD_VERSION .
- cp /build/* release/
- ls -lah release/
environment:
BUILD_VERSION: ${DRONE_TAG##v}
2020-01-15 13:12:32 +01:00
- name: checksum
image: alpine
commands:
- cd release/ && sha256sum * > sha256sum.txt
- cat sha256sum.txt
2020-01-15 10:00:03 +01:00
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
2020-01-15 13:12:32 +01:00
files:
- release/*
2020-01-15 10:00:03 +01:00
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: manifest
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
2020-01-14 15:39:08 +01:00
when:
status:
- success
- name: readme
image: sheogorath/readme-to-dockerhub
environment:
DOCKERHUB_PASSWORD:
from_secret: docker_password
DOCKERHUB_REPO_NAME: github-releases-notifier
DOCKERHUB_REPO_PREFIX: xoxys
DOCKERHUB_USERNAME:
from_secret: docker_username
README_PATH: README.md
SHORT_DESCRIPTION: Receive Slack notifications for new GitHub releases
- name: microbadger
2020-01-14 16:18:12 +01:00
image: plugins/webhook
settings:
urls:
from_secret: microbadger_url
2020-01-14 15:12:01 +01:00
when:
status:
- success
- 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/**
2020-01-14 15:39:08 +01:00
status:
- success
- failure
depends_on:
2020-01-14 15:08:20 +01:00
- build-container-amd64
- build-container-arm64
- build-container-arm
2020-01-15 10:00:03 +01:00
- build-binaries
2020-01-14 14:44:08 +01:00
---
kind: signature
2020-01-15 13:12:32 +01:00
hmac: dfd7579768ef56661e69f51498b32a2cedc72869c01876711963f7f9b8d76fc4
2020-01-14 14:44:08 +01:00
...