Skip to content

Commit

Permalink
feat: tag script fixes and additions to support 3.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Regolith Linux committed Aug 27, 2024
1 parent 377aeb6 commit e163761
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/scripts/tag-stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ set -e
tag_package() {
TAG=$1
if [ $(git tag -l "$TAG") ]; then
: # echo "# ignoring, $TAG already exists for $PACKAGE_NAME"
else
echo "# Creating new tag $TAG on $PACKAGE_SOURCE_REF for $PACKAGE_NAME"
git tag $TAG
# echo "# Pushing tag $TAG for $PACKAGE_NAME"

if [ -z "$DRY_RUN" ]; then
git push origin $TAG
else
echo "# (dry-run): git push origin $TAG"
fi
if [ -z "$DRY_RUN" ]; then
git push --delete origin "$TAG" || :
git tag -d "$TAG"
else
echo "# (dry-run): delete local and remote tag $TAG"
git tag -d "$TAG"
fi
fi

echo "# Creating new tag $TAG on $PACKAGE_SOURCE_REF for $PACKAGE_NAME"
git tag $TAG
# echo "# Pushing tag $TAG for $PACKAGE_NAME"

if [ -z "$DRY_RUN" ]; then
git push origin $TAG
else
echo "# (dry-run): git push origin $TAG"
fi

# Print special cases for auditing
if [ "$TAG" != "$DEFAULT_DEST_TAG" ]; then
echo "# SPECIAL $STAGE-$DISTRO-$CODENAME $PACKAGE_NAME tag: $TAG source: ($PACKAGE_SOURCE_REF)"
fi
# Print special cases for auditing
if [ "$TAG" != "$DEFAULT_DEST_TAG" ]; then
echo "# SPECIAL $STAGE-$DISTRO-$CODENAME $PACKAGE_NAME tag: $TAG source: ($PACKAGE_SOURCE_REF)"
fi
}

Expand All @@ -41,6 +47,11 @@ handle_package() {

pushd $PKG_WORK_DIR > /dev/null

if [[ $PACAKGE_SOURCE_URL == https://* ]]; then
# Extract domain, user, and repo name
PACAKGE_SOURCE_URL=$(echo $PACAKGE_SOURCE_URL | sed -r 's|https://([^/]*)/([^/]*)/([^/]*)(.git)?|git@\1:\2/\3|')
fi

if [ -d "$PACKAGE_NAME" ]; then
pushd "$PACKAGE_NAME" > /dev/null
git fetch
Expand Down

0 comments on commit e163761

Please sign in to comment.