Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
dist
63 changes: 63 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
project_name: github-releases-notifier
release:
github:
owner: justwatchcom
name: github-releases-notifier
name_template: '{{ .Tag }}'
builds:
- goos:
- linux
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- "6"
main: .
binary: github-releases-notifier
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -extldflags '-static'

snapshot:
name_template: SNAPSHOT-{{ .Commit }}

checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
dist: dist
changelog:
filters:
exclude:
- typo
- Fix
- Merge
- WIP
archive:
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format: tar.gz
files:
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
dockers:
- image: justwatchcom/github-releases-notifier
goos: linux
goarch: amd64
goarm: ''
binary: propaganda
dockerfile: Dockerfile.amd64
- image: justwatchcom/github-releases-notifier-armv6
goos: linux
goarch: arm
goarm: '6'
binary: propaganda
dockerfile: Dockerfile.armv6
- image: justwatchcom/github-releases-notifier-arm64
goos: linux
goarch: arm64
binary: propaganda
dockerfile: Dockerfile.arm64
env_files:
github_token: ~/.goreleaser.token
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
language: go

go:
- 1.8.x
- 1.10.x

services:
- docker

before_install:
- go get -u github.com/golang/dep/cmd/dep
- go get -v github.com/golang/lint/golint
- go get -d github.com/goreleaser/goreleaser
- cd $GOPATH/src/github.com/goreleaser/goreleaser
- dep ensure -vendor-only
- make setup build
- go install
- cd -

script:
- make clean
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.8 as builder
FROM golang:1.9 as builder

ADD . /go/src/github.com/justwatchcom/github-releases-notifier
WORKDIR /go/src/github.com/justwatchcom/github-releases-notifier
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.9 as builder

ADD . /go/src/github.com/justwatchcom/github-releases-notifier
WORKDIR /go/src/github.com/justwatchcom/github-releases-notifier

RUN make buildarm

FROM arm64v8/alpine:3.7
RUN apk --no-cache add ca-certificates

COPY --from=builder \
/go/src/github.com/justwatchcom/github-releases-notifier/github-releases-notifier \
/bin/github-releases-notifier

ENTRYPOINT [ "/bin/github-releases-notifier" ]
15 changes: 15 additions & 0 deletions Dockerfile.armv6
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.9 as builder

ADD . /go/src/github.com/justwatchcom/github-releases-notifier
WORKDIR /go/src/github.com/justwatchcom/github-releases-notifier

RUN make buildarm

FROM arm32v6/alpine:3.7
RUN apk --no-cache add ca-certificates

COPY --from=builder \
/go/src/github.com/justwatchcom/github-releases-notifier/github-releases-notifier \
/bin/github-releases-notifier

ENTRYPOINT [ "/bin/github-releases-notifier" ]
27 changes: 7 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
DIST := dist
BIN := bin

EXECUTABLE := github-releases-notifier

PWD := $(shell pwd)
VERSION := $(shell cat VERSION)
SHA := $(shell cat COMMIT 2>/dev/null || git rev-parse --short=8 HEAD)
DATE := $(shell date -u '+%FT%T%z')

GOLDFLAGS += -X "main.version=$(VERSION)"
GOLDFLAGS += -X "main.date=$(DATE)"
GOLDFLAGS += -X "main.commit=$(SHA)"
GOLDFLAGS += -extldflags '-static'

GO := CGO_ENABLED=0 go

GOOS ?= $(shell go version | cut -d' ' -f4 | cut -d'/' -f1)
GOARCH ?= $(shell go version | cut -d' ' -f4 | cut -d'/' -f2)
GO := go

PACKAGES ?= $(shell go list ./... | grep -v /vendor/ | grep -v /tests)

Expand All @@ -29,6 +13,7 @@ all: clean test build
clean:
$(GO) clean -i ./...
find . -type f -name "coverage.out" -delete
if [ -f Dockerfile ]; then rm Dockerfile ; fi

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -67,7 +52,9 @@ test:
STATUS=0; for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || STATUS=1; done; exit $$STATUS

.PHONY: build
build: $(EXECUTABLE)-$(GOOS)-$(GOARCH)
build:
goreleaser --snapshot --rm-dist

$(EXECUTABLE)-$(GOOS)-$(GOARCH): $(wildcard *.go)
$(GO) build -tags '$(TAGS)' -ldflags '-s -w $(GOLDFLAGS)' -o $(EXECUTABLE)
.PHONY: release
release:
goreleaser --rm-dist