Skip to content

Commit

Permalink
ci: Update release pipeline (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed May 18, 2019
1 parent 54a5a27 commit 36a4a07
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,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
36 changes: 23 additions & 13 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ project_name: keto

env:
- GO111MODULE=on

before:
hooks:
- go mod download
- packr

builds:
-
flags:
Expand All @@ -31,22 +33,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 @@ -70,8 +77,11 @@ dockers:
- "oryd/keto:v{{ .Major }}"
- "oryd/keto:v{{ .Major }}.{{ .Minor }}"
- "oryd/keto:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
# - "oryd/keto:{{ .Env.DOCKER_FULL_TAG }}"
- "oryd/keto:{{ .Env.DOCKER_SHORT_TAG }}"
- "oryd/keto:latest"
extra_files:
- .releaser/LICENSE.txt
- .releaser/LICENSE.txt

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

0 comments on commit 36a4a07

Please sign in to comment.