Skip to content

Commit

Permalink
ci: Resolve goreleaser issues (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored May 18, 2019
1 parent 36a4a07 commit 5753f27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ jobs:
- MYSQL_ROOT_PASSWORD=test
working_directory: /go/src/github.com/ory/keto
steps:
- checkout
- setup_remote_docker
- run:
name: Enable go1.11 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
./.circleci/release_name.bash
echo 'export DOCKER_SHORT_TAG=$CIRCLE_SHA1' >> $BASH_ENV
source $BASH_ENV
- checkout

# Installation
- run: go mod verify
- run: go install github.com/ory/keto
Expand All @@ -66,6 +67,7 @@ jobs:

# Submit coverage details
- run: test -z "$CIRCLE_PR_NUMBER" && goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN || echo "forks are not allowed to push to coveralls"
- run: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist

release:
docker:
Expand All @@ -83,8 +85,6 @@ jobs:
source $BASH_ENV
- setup_remote_docker
- run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- run: cp ./.releaser/LICENSE.txt ./LICENSE.txt
- run: go install github.com/gobuffalo/packr/packr
- run: curl -sL https://git.io/goreleaser | bash

release-docs:
Expand Down
4 changes: 3 additions & 1 deletion .circleci/release_name.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tag_name=$(echo ${release} | jq -r ".[0].name")

if [[ -n "$tag_name" ]]; then
echo "export RELEASE_NAME=$tag_name" >> $BASH_ENV
else
elif [[ -n "$tag" ]]; then
echo "export RELEASE_NAME=$tag" >> $BASH_ENV
else
echo "export RELEASE_NAME=$CIRCLE_SHA1" >> $BASH_ENV
fi
6 changes: 4 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ env:
before:
hooks:
- go mod download
- cp ./.releaser/LICENSE.txt ./LICENSE.txt
- go install github.com/gobuffalo/packr/packr
- packr

builds:
-
flags:
- -a
ldflags:
- -s -w -X github.com/ory/keto/cmd.Version={{.Tag}} -X github.com/ory/keto/cmd.Commit={{.FullCommit}} -X github.com/ory/keto/cmd.Date={{.Date}}
- -s -w -X github.com/ory/keto/cmd.Version={{.Env.RELEASE_NAME}} -X github.com/ory/keto/cmd.Commit={{.FullCommit}} -X github.com/ory/keto/cmd.Date={{.Date}}
binary: keto
env:
- CGO_ENABLED=0
Expand All @@ -34,7 +36,7 @@ builds:
- windows
- darwin

archive:
archives:
-
replacements:
darwin: macOS
Expand Down

0 comments on commit 5753f27

Please sign in to comment.