Skip to content

Commit

Permalink
Write version to intermediate file for release publish
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Dec 7, 2018
1 parent 66f0e34 commit 01c07cd
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ jobs:
command: 'bazel run //:buildifier_check ||
(echo "ERROR: Bazel files not formatted, please run \`bazel run :buildifier\`" >&2; exit 1)'
when: always
write_release_version:
docker:
- image: docker:git
working_directory: /src
steps:
- checkout
- run: git describe --tags --abbrev=0 > VERSION
- persist_to_workspace:
root: ./
paths:
- VERSION
build_linux_release:
docker:
- image: jfbrandhorst/grpc-gateway-build-env
Expand Down Expand Up @@ -147,13 +158,12 @@ jobs:
- image: cibuilds/github:0.10
steps:
- attach_workspace:
at: ./release
- checkout
at: /workspace
- run:
name: "Publish Release on GitHub"
command: |
VERSION=$(git describe --tags --abbrev=0)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ./release/
VERSION=$(cat /workspace/VERSION)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} /workspace/release/
workflows:
version: 2
all:
Expand All @@ -164,6 +174,12 @@ workflows:
- generate
- lint
- bazel
- write_release_version:
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+$/
- build_linux_release:
filters:
branches:
Expand All @@ -184,6 +200,7 @@ workflows:
only: /^v\d+\.\d+\.\d+$/
- publish_github_release:
requires:
- write_release_version
- build_linux_release
- build_darwin_release
- build_windows_release
Expand Down

0 comments on commit 01c07cd

Please sign in to comment.