forked from kubernetes-sigs/external-dns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds release script (kubernetes-sigs#1794)
* adds release script Signed-off-by: Raffaele Di Fazio <raffo@github.com> * save Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com> * scripts Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com> * update script Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com> * update docs Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com> * Update releaser.sh
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 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
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,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
sed -i -e "s/newTag: .*/newTag: $1/g" kustomize/kustomization.yaml | ||
git add kustomize/kustomization.yaml | ||
git commit -sm "updates kustomize with newly released version" |
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,35 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
current_tag="${GITHUB_REF#refs/tags/}" | ||
start_ref="HEAD" | ||
|
||
function generate_changelog { | ||
# Find the previous release on the same branch, skipping prereleases if the | ||
# current tag is a full release | ||
previous_tag="" | ||
while [[ -z $previous_tag || ( $previous_tag == *-* && $current_tag != *-* ) ]]; do | ||
previous_tag="$(git describe --tags "$start_ref"^ --abbrev=0)" | ||
start_ref="$previous_tag" | ||
done | ||
|
||
git log "$previous_tag".. --reverse --merges --oneline --grep='Merge pull request #' | \ | ||
while read -r sha title; do | ||
pr_num="$(grep -o '#[[:digit:]]\+' <<<"$title")" | ||
pr_desc="$(git show -s --format=%b "$sha" | sed -n '1,/^$/p' | tr $'\n' ' ')" | ||
pr_author="$(gh pr view "$pr_num" | grep author | awk '{ print $2 }' | tr $'\n' ' ')" | ||
printf "* %s (%s) @%s\n\n" "$pr_desc" "$pr_num" "$pr_author" | ||
done | ||
} | ||
|
||
function create_release { | ||
generate_changelog | gh release create "$1" -t "$1" -F - | ||
} | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "$0: usage: releaser [release number]" | ||
echo "example: ./releaser.sh v0.7.5" | ||
exit 1 | ||
fi | ||
|
||
create_release "$1" |