-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prasad Ghangal <[email protected]>
- Loading branch information
1 parent
aae2eb8
commit b3e0397
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
release=v0.0.0 |
This file contains 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,58 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -e | ||
|
||
version=$(cut -d'=' -f2- .release) | ||
if [[ -z ${version} ]]; then | ||
echo "Invalid version set in .release" | ||
exit 1 | ||
fi | ||
|
||
|
||
if [[ -z ${GITHUB_TOKEN} ]]; then | ||
echo "GITHUB_TOKEN not set. Usage: GITHUB_TOKEN=<TOKEN> ./hack/release.sh" | ||
exit 1 | ||
fi | ||
|
||
echo "Publishing release ${version}" | ||
|
||
generate_changelog() { | ||
local version=$1 | ||
|
||
# generate changelog from github | ||
github_changelog_generator infracloudio/msbotbuilder-go -t ${GITHUB_TOKEN} --future-release ${version} -o CHANGELOG.md | ||
sed -i '$d' CHANGELOG.md | ||
} | ||
|
||
publish_release() { | ||
local version=$1 | ||
|
||
# create gh release | ||
gothub release \ | ||
--user infracloudio \ | ||
--repo msbotbuilder-go \ | ||
--tag $version \ | ||
--name "$version" \ | ||
--description "$version" | ||
} | ||
|
||
make_release() { | ||
local version=$1 | ||
|
||
# tag release | ||
git add .release CHANGELOG.md | ||
git commit -m "Release $version" ; | ||
git tag $version ; | ||
git push --tags origin develop; | ||
echo 'Git tag pushed successfully' ; | ||
} | ||
|
||
generate_changelog $version | ||
make_release $version | ||
publish_release $version | ||
|
||
echo "=========================== Done =============================" | ||
echo "Congratulations!! Release ${version} published." | ||
echo "Don't forget to add changelog in the release description." | ||
echo "==============================================================" |