-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Build: Save build artifact and publish release #2633
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
Merged
mattklein123
merged 11 commits into
envoyproxy:master
from
taion809:feat-add-linux-binaries
Mar 14, 2018
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a21b226
Build: Save build artifact and publish release
taion809 7fd5126
Added save_artifacts to save artifacts on ci release
taion809 3c28ffd
wrap mv in a file test
taion809 73023f3
fixed github_release to validate and use envvar
taion809 442f364
moved publishing to separate script
taion809 7ff0f07
Fix publish script path
taion809 65d34d9
exit 1 when environment variables are unset
taion809 9ee83f6
bugfix: ensure we only run when CIRCLE_TAG is populated
taion809 4e3a215
remove unnecessary if block
taion809 6327141
move tag check to beginning for early exit
taion809 557e8ae
only attach a file to an existing release
taion809 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/bin/bash | ||
|
|
||
| # NOTE: please do not set trace mode (-x) | ||
| # as it will leak credentials in the logs. | ||
| set -e | ||
|
|
||
| if [[ -z "${CIRCLE_TAG:-}" ]]; then | ||
| echo "skipping non tag events" | ||
| exit 0 | ||
| fi | ||
|
|
||
| if [[ ! -f "${ENVOY_SRCDIR}/build_release_stripped/envoy" ]]; then | ||
| echo "could not locate envoy binary at path: ${ENVOY_SRCDIR}/build_release_stripped/envoy" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "${GITHUB_TOKEN:-}" ]]; then | ||
| echo "environment variable GITHUB_TOKEN unset; cannot continue with publishing." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "${GITHUB_USER:-}" ]]; then | ||
| echo "environment variable GITHUB_USER unset; cannot continue with publishing." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -z "${GITHUB_REPO:-}" ]]; then | ||
| echo "environment variable GITHUB_REPO unset; cannot continue with publishing." | ||
| exit 1 | ||
| fi | ||
|
|
||
| wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 -O /tmp/ghrelease.tar.bz2 | ||
| tar -xvjpf /tmp/ghrelease.tar.bz2 -C /tmp | ||
| cp /tmp/bin/linux/amd64/github-release /usr/local/bin/ghrelease | ||
| chmod +x /usr/local/bin/ghrelease | ||
|
|
||
| ghrelease upload --tag "${CIRCLE_TAG:-}" --name "envoy-linux-amd64" --file "${ENVOY_SRCDIR}/build_release_stripped/envoy" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be run on every repository event, resulting in a release created for every merge?
We've historically handled this by adding a check in the script to only publish/release for tag events. Here's an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fixed, great catch!