Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Resolve goreleaser issues #192

Merged
merged 8 commits into from
May 18, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
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