Skip to content

Commit

Permalink
Use goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Aug 2, 2019
1 parent c282bc1 commit fe0e45a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 10 deletions.
47 changes: 37 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ workflows:
all:
jobs:
- build
- release:
requires:
- build
- docker:
requires:
- build
filters:
branches:
only: master
jobs:
build:
docker:
- image: golang
environment:
GO111MODULE: 'on'
GO111MODULE: "on"
working_directory: /go/src/github.com/raviqqe/muffet
steps:
- checkout
Expand All @@ -29,11 +35,30 @@ jobs:
rake serve
sleep 1
rake integration_test
- run: ./muffet --version > version
- persist_to_workspace:
root: .
paths:
- version
- muffet
release:
docker:
- image: golang
environment:
GO111MODULE: "on"
steps:
- checkout
- attach_workspace:
at: .
- run: |
version=$(./muffet --version)
if git tag -l | grep $version
then
exit 0
fi
git tag $version
git push --tags
curl -sL https://git.io/goreleaser | bash
docker:
docker:
- image: docker:17
Expand All @@ -44,13 +69,15 @@ jobs:
at: .
- run: |
name=$DOCKER_USER/muffet
version=$(cat version)
version=$(./muffet --version)
if [ $CIRCLE_BRANCH = master -a $version != $(docker run $name --version) ]
if [ $version == $(docker run $name --version) ]
then
docker build -t $name .
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push $name
docker tag $name $name:$version
docker push $name:$version
exit 0
fi
docker build -t $name .
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker push $name
docker tag $name $name:$version
docker push $name:$version
20 changes: 20 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
builds:
- env:
- CGO_ENABLED=0
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit fe0e45a

Please sign in to comment.