-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating automation to help create releases. (#523)
* Adding releage tagging script to help with releases. Signed-off-by: Scott Nichols <snichols@vmware.com> * adding tagging and pushing Signed-off-by: Scott Nichols <snichols@vmware.com>
- Loading branch information
Scott Nichols
authored
May 27, 2020
1 parent
046759a
commit 4ca23c8
Showing
3 changed files
with
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- 'protocol*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Create Draft Releases | ||
|
||
jobs: | ||
|
||
release-tags: | ||
name: draft-release | ||
|
||
steps: | ||
|
||
- name: Create Draft Release | ||
id: create_draft_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false |
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,61 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
VERSION=v2.0.0 | ||
|
||
# It is intended that this file is run locally. For a full release tag, confirm the version is correct, and then: | ||
# ./hack/tag-release.sh --tag --push | ||
|
||
CREATE_TAGS=0 # default is a dry run | ||
PUSH_TAGS=0 # Assumes `upstream` is the remote name for sdk-go. | ||
|
||
# Loop through arguments and process them | ||
for arg in "$@" | ||
do | ||
case $arg in | ||
-t|--tag) | ||
CREATE_TAGS=1 | ||
shift | ||
;; | ||
-p|--push) | ||
PUSH_TAGS=1 | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
echo --- All Modules --- | ||
for gomodule in $(find . | grep "go\.mod" | awk '{gsub(/\/go.mod/,""); print $0}' | grep -v "./v2/test") | ||
do | ||
echo " $gomodule" | ||
done | ||
|
||
echo --- Tagging --- | ||
|
||
MODULES=( | ||
"" # root module | ||
"protocol/amqp" | ||
"protocol/stan" | ||
"protocol/nats" | ||
"protocol/pubsub" | ||
"protocol/kafka_sarama" | ||
) | ||
|
||
for i in "${MODULES[@]}"; do | ||
tag="" | ||
if [ "$i" = "" ]; then | ||
tag="$VERSION" | ||
else | ||
tag="$i/$VERSION" | ||
fi | ||
echo " $tag" | ||
if [ "$CREATE_TAGS" -eq "1" ]; then | ||
git tag $TAG | ||
fi | ||
if [ "$PUSH_TAGS" -eq "1" ]; then | ||
git push upstream $TAG | ||
fi | ||
done |
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