-
Notifications
You must be signed in to change notification settings - Fork 757
Add release scripts for the Go client #703
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
Closed
Closed
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
tag=${1:-} | ||
if [[ -z "${tag}" ]]; then | ||
echo "missing tag" | ||
echo "usage: post-release.sh <tag>" | ||
exit 1 | ||
fi | ||
|
||
WC='\033[0;36m' | ||
NC='\033[0m' | ||
echo -e "${WC}=== Cleaning up === ${NC}" | ||
|
||
# Return master to development mode once again. | ||
mv go_test.mod go.mod | ||
mv go_test.sum go.sum | ||
|
||
go test ./... -p=1 -v | ||
|
||
echo | ||
echo -e "${WC}=== Run the following commands to finish the release === ${NC}" | ||
echo | ||
echo " git add go.mod go.sum" | ||
echo " git rm go_test.mod go_test.sum" | ||
echo " git commit -s -m 'Post Release ${tag} steps'" | ||
echo " git checkout master" | ||
echo " git merge --no-ff 'release/${tag}'" | ||
echo " git push origin master" | ||
echo | ||
echo " # Delete release branch" | ||
echo " git push origin :release/${tag}" | ||
echo | ||
echo | ||
echo |
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,64 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
tag=${1:-} | ||
if [[ -z "${tag}" ]]; then | ||
echo "missing tag" | ||
echo "usage: pre-release.sh <tag>" | ||
exit 1 | ||
fi | ||
|
||
WC='\033[0;36m' | ||
NC='\033[0m' | ||
echo -e "${WC}=== Creating release branch === ${NC}" | ||
|
||
releaseBranch="release/${tag}" | ||
git checkout -b "${releaseBranch}" | ||
mv go.mod go_test.mod | ||
mv go.sum go_test.sum | ||
|
||
# Start with empty go.mod file | ||
go mod init | ||
|
||
# Build example with the minimal go.mod, this will leave out test dependencies. | ||
# -mod flag instructs to fetch dependencies as needed. | ||
echo -e "${WC}=== Building minimal go.mod === ${NC}" | ||
go build -mod=mod examples/nats-sub/main.go | ||
|
||
# Run the tests locally and confirm they pass. | ||
echo -e "${WC}=== Running tests === ${NC}" | ||
sleep 1 | ||
|
||
# Use readonly to ensure that dependencies are not changed while running tests. | ||
go test ./... -p=1 -v -modfile=go_test.mod -mod=readonly | ||
|
||
# Confirm the different in dependencies. go_test.mod should only have test | ||
# dependencies. | ||
modDiff=$(diff go.mod go_test.mod || true) | ||
if [[ -z "${modDiff}" ]]; then | ||
echo "go.mod and go_test.mod are the same" | ||
echo "confirm that test dependencies are being left out and try again" | ||
exit 1 | ||
fi | ||
|
||
echo | ||
echo -e "${WC}=== diff go.mod go_test.mod === ${NC}" | ||
echo | ||
echo "${modDiff}" | ||
echo | ||
echo | ||
read -e -r -p "Are the test dependencies left out? [y/n] " diffOk | ||
if ! [[ "$diffOk" =~ ^(yes|y)$ ]]; then | ||
echo "diff not ok, aborting" | ||
exit 1 | ||
fi | ||
|
||
echo | ||
echo -e "${WC}=== Run the following commands to tag the release === ${NC}" | ||
echo | ||
echo " git add go.mod go.sum go_test.mod go_test.sum" | ||
echo " git commit -s -m 'Release ${tag}'" | ||
echo " git tag -m '${tag}' -a ${tag}" | ||
echo " git push origin ${releaseBranch} --tags" | ||
echo | ||
echo |
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.
Question: we use
-modfile
here and line above, but ./scripts/cov.sh is not. Is that a problem?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.
Yes those entries were missing
-modfile
so have updated now.