Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaglow committed Aug 15, 2018
1 parent ce30aa7 commit 5370e7a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
22 changes: 22 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
project_name: cortexbot
builds:
- env:
- CGO_ENABLED=0
main: ./cmd/cortexbot/main.go
archive:
replacements:
darwin: darwin
linux: linux
windows: windows
386: i386
amd64: amd64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ go:
- "1.10"
- master

addons:
apt:
packages:
- rpm
- snapd

env:
- PATH=/snap/bin:$PATH

install:
- go get -d -v ./...
- sudo snap install snapcraft --classic

script:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- go test -v -covermode=count -coverprofile=coverage.out
- goveralls -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN

before_deploy:
- cd cmd/cortexbot
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -gcflags="-trimpath=$GOPATH" -asmflags="-trimpath=$GOPATH" -a -installsuffix cgo -o cortexbot-amd64
- CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -gcflags="-trimpath=$GOPATH" -asmflags="-trimpath=$GOPATH" -a -installsuffix cgo -o cortexbot-386
- CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -gcflags="-trimpath=$GOPATH" -asmflags="-trimpath=$GOPATH" -a -installsuffix cgo -o cortexbot-x86.exe
- CGO_ENABLED=0 GOOS=darwin go build -ldflags="-s -w" -gcflags="-trimpath=$GOPATH" -asmflags="-trimpath=$GOPATH" -a -installsuffix cgo -o cortexbot-mac

deploy:
provider: releases
api_key: $GITHUB_TOKEN
provider: script
skip_cleanup: true
file:
- cortexbot-amd64
- cortexbot-386
- cortexbot-x86.exe
- cortexbot-mac
script: curl -sL https://git.io/goreleaser | bash
on:
repo: ilyaglow/cortex-tgbot
tags: true
condition: $TRAVIS_GO_VERSION = "1.10"
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ LABEL maintainer "contact@ilyaglotov.com"
LABEL repository "https://github.com/ilyaglow/cortex-tgbot"

ENV CORTEXBOT_VERSION "0.9.2"

ADD https://github.com/ilyaglow/cortex-tgbot/releases/download/v${CORTEXBOT_VERSION}/cortexbot-amd64 /app/cortexbot
ADD https://github.com/ilyaglow/cortex-tgbot/releases/download/v${CORTEXTBOT_VERSION}/cortexbot_linux_amd64.tar.gz /app/

RUN chmod +x /app/cortexbot

Expand Down

0 comments on commit 5370e7a

Please sign in to comment.