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

Write version to intermediate file for release publish #826

Merged
merged 1 commit into from
Dec 7, 2018
Merged
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
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