Skip to content

Commit

Permalink
ci: Resolve goreleaser issues (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed May 18, 2019
1 parent 26a44f9 commit e496bec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ jobs:
working_directory: /go/src/github.com/ory/oathkeeper
steps:
- checkout
- setup_remote_docker
- run:
command: |
./.circleci/release_name.bash
echo 'export DOCKER_SHORT_TAG=$CIRCLE_SHA1' >> $BASH_ENV
source $BASH_ENV
- run: go mod download
- run: go install github.com/ory/go-acc github.com/mattn/goveralls
- run: go-acc -o coverage.txt ./... -- -failfast -timeout=20m
- 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: ./test/e2e/run.sh
- run: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist

release:
docker:
Expand All @@ -67,7 +74,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: curl -sL https://git.io/goreleaser | bash

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
5 changes: 3 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ env:
before:
hooks:
- go mod download
- cp ./.releaser/LICENSE.txt ./LICENSE.txt

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

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

0 comments on commit e496bec

Please sign in to comment.