From a7c989263eb30cc09fa726c9ed9b292d79ca62a1 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Wed, 23 Dec 2015 15:17:14 +0100 Subject: [PATCH] Added makefile, updated docs --- .drone.yml | 14 ++++---------- DOCS.md | 6 +++--- Dockerfile | 10 +++++++--- Makefile | 25 +++++++++++++++++++++++++ README.md | 45 ++++++++++++++++++++++++++++++++++++++------- 5 files changed, 77 insertions(+), 23 deletions(-) create mode 100644 Makefile diff --git a/.drone.yml b/.drone.yml index b098dca..18d1f2a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,14 +1,9 @@ build: image: golang:1.5 - environment: - - GO15VENDOREXPERIMENT=1 - - GOOS=linux - - GOARCH=amd64 - - CGO_ENABLED=0 commands: - - go get - - go build - - go test + - make deps + - make build + - make test publish: docker: @@ -21,10 +16,9 @@ publish: plugin: name: GitHub Release - desc: Publish files and artifacts to GitHub releases + desc: Publishs files and artifacts to GitHub Releases type: publish image: plugins/drone-github-release labels: - - publish - github - release diff --git a/DOCS.md b/DOCS.md index a88acb9..7ecd3f7 100644 --- a/DOCS.md +++ b/DOCS.md @@ -2,9 +2,9 @@ Use this plugin for publishing files and artifacts to GitHub releases. You can override the default configuration with the following parameters: * `api_key` - GitHub oauth token with public_repo or repo permission -* `files` - Files to upload to GitHub Release; globs are allowed -* `base_url` - GitHub base URL; only required for GHE -* `upload_url` - GitHub upload URL; only required for GHE +* `files` - Files to upload to GitHub Release, globs are allowed +* `base_url` - GitHub base URL, only required for GHE +* `upload_url` - GitHub upload URL, only required for GHE Sample configuration: diff --git a/Dockerfile b/Dockerfile index 4917c29..715651b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,14 @@ # Docker image for the Drone GitHub Release plugin # # cd $GOPATH/src/github.com/drone-plugins/drone-github-release -# GO15VENDOREXPERIMENT=1 CGO_ENABLED=0 go build -a -tags netgo -# docker build --rm=true -t plugins/drone-github-release . +# make deps build docker FROM alpine:3.2 -RUN apk add -U ca-certificates && rm -rf /var/cache/apk/* + +RUN apk update && \ + apk add \ + ca-certificates && \ + rm -rf /var/cache/apk/* + ADD drone-github-release /bin/ ENTRYPOINT ["/bin/drone-github-release"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3d2a4f --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.PHONY: clean deps test build docker + +export GOOS ?= linux +export GOARCH ?= amd64 +export CGO_ENABLED ?= 0 + +CI_BUILD_NUMBER ?= 0 + +LDFLAGS += -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')" +LDFLAGS += -X "main.build=$(CI_BUILD_NUMBER)" + +clean: + go clean -i ./... + +deps: + go get -t ./... + +test: + go test -cover ./... + +build: + go build -ldflags '-s -w $(LDFLAGS)' + +docker: + docker build --rm=true -t plugins/drone-github-release . diff --git a/README.md b/README.md index db799be..6f9858f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # drone-github-release +[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-github-release/status.svg)](http://beta.drone.io/drone-plugins/drone-github-release) +[![](https://badge.imagelayers.io/plugins/drone-github-release:latest.svg)](https://imagelayers.io/?images=plugins/drone-github-release:latest 'Get your own badge on imagelayers.io') + Drone plugin for publishing GitHub releases ## Usage -Publish a release: - ``` ./drone-github-release <