Skip to content

Commit

Permalink
Add script to auto tag releases when release docs job run (aws#2979)
Browse files Browse the repository at this point in the history
* add script to auto tag releases when release docs job run

* remove echos and add remote print
  • Loading branch information
rcrozean authored May 2, 2024
1 parent 573db9b commit a1fb559
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions release/github_tag_doc_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

BASE_DIRECTORY=$(git rev-parse --show-toplevel)
cd ${BASE_DIRECTORY}

while read ANNOUNCEMENT; do
RELEASE_TAG=$(echo "${ANNOUNCEMENT}" | grep -o -E "[[:digit:]]{1}\-[[:digit:]]{2}-eks-[[:digit:]]{1,2}") # e.g. 1-25-eks-36
if [ -z "$RELEASE_TAG" ]; then
echo "Failed to publish release notification: Unable to generate release number for notification subject"
exit 1
elif [ -z "${PULL_BASE_SHA}" ]; then
echo "Must be run in a Prowjob for access to PULL_BASE_SHA"
exit 1
fi
git remote -v # TODO: Remove once we confirm the git repo has the correct remotes.
git tag -a ${RELEASE_TAG} ${BASE_PULL_SHA} -m ${RELEASE_TAG}
git push upstream ${RELEASE_TAG}

done <$(git -C . diff --name-only HEAD^ HEAD | grep '^docs/contents/releases' | grep release-announcement.txt)

0 comments on commit a1fb559

Please sign in to comment.