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: Update release pipeline #191

Merged
merged 1 commit 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
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ jobs:
release:
docker:
- image: circleci/golang:1.12
environment:
- GO111MODULE=on
working_directory: /go/src/github.com/ory/oathkeeper
steps:
- checkout
- run:
name: Enable go1.12 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
echo 'export DOCKER_FULL_TAG=$(echo $CIRCLE_TAG | tr '+' '_')' >> $BASH_ENV
echo 'export DOCKER_SHORT_TAG=$(echo $CIRCLE_TAG | cut -d '+' -f1)' >> $BASH_ENV
./.circleci/release_name.bash
source $BASH_ENV
- checkout
- setup_remote_docker
- run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- run: cp ./.releaser/LICENSE.txt ./LICENSE.txt
Expand Down
11 changes: 11 additions & 0 deletions .circleci/release_name.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

release=$(curl -s "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/releases")
tag=$(echo ${release} | jq -r ".[0].tag_name")
tag_name=$(echo ${release} | jq -r ".[0].name")

if [[ -n "$tag_name" ]]; then
echo "export RELEASE_NAME=$tag_name" >> $BASH_ENV
else
echo "export RELEASE_NAME=$tag" >> $BASH_ENV
fi
34 changes: 22 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ project_name: oathkeeper

env:
- GO111MODULE=on

before:
hooks:
- go mod download

builds:
-
flags:
Expand All @@ -30,22 +32,27 @@ builds:
- linux
- windows
- darwin

archive:
replacements:
darwin: macOS
linux: Linux
windows: Windows
386: 32-bit
amd64: 64-bit
format_overrides:
- goos: windows
format: zip
files:
- LICENSE.txt
-
replacements:
darwin: macOS
linux: Linux
windows: Windows
386: 32-bit
amd64: 64-bit
format_overrides:
- goos: windows
format: zip
files:
- LICENSE.txt

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc

brew:
github:
owner: ory
Expand All @@ -69,8 +76,11 @@ dockers:
- "oryd/oathkeeper:v{{ .Major }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}"
- "oryd/oathkeeper:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
# - "oryd/oathkeeper:{{ .Env.DOCKER_FULL_TAG }}"
- "oryd/oathkeeper:{{ .Env.DOCKER_SHORT_TAG }}"
- "oryd/oathkeeper:latest"
extra_files:
- .releaser/LICENSE.txt

release:
prerelease: auto
name_template: "{{.Env.RELEASE_NAME}}"