Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ http_archive(
name = "${WORKSPACE_NAME}",
url = "https://github.com/helly25/${PACKAGE_NAME}/releases/download/${TAG}/${ARCHIVE}",
sha256 = "${SHA256}",
strip_prefix = "${PREFIX}",
)
\`\`\`
EOF
2 changes: 1 addition & 1 deletion tools/header.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com)
# SPDX-FileCopyrightText: Copyright (c) The helly25 authors (helly25.com)
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
33 changes: 31 additions & 2 deletions tools/trigger_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ fi

grep "${VERSION}" < <(git tag -l) && die "Version tag is already in use."

git tag -s -a "${VERSION}"
git tag -s -a "${VERSION}" \
-m "New release tag version: '${VERSION}'." \
-m "$(awk '/^#/{if(NR>1)exit}/^[^#]/{print}' <CHANGELOG.md)"
git push origin --tags

echo "Next version: ${NEXT_VERSION}"
Expand All @@ -73,5 +75,32 @@ git commit -m "Bump version to ${NEXT_VERSION}"
git push -u origin "${NEXT_BRANCH}"
git push
if which gh; then
gh pr create --title "Bump version to ${NEXT_VERSION}" -b "Created by ${0}."
PRNUM=""
PRURL=""
BUMP_TEXT="Bump version from ${VERSION} to ${NEXT_VERSION}"
MERGE_TITLE="${BUMP_TEXT}"
MERGE_SUBJECT="${BUMP_TEXT}"
MERGE_BODY="Auto approved version bump from ${VERSION} to ${NEXT_VERSION} by trigger script."
if gh pr create --title "${MERGE_TITLE}" -b "Created by ${0}." 2>&1 | tee pr_create_output.txt; then
PRNUM="$(sed -rne 's,https?://github.com/[^/]+/[^/]+/pull/([0-9]+)$,\1,p' < pr_create_output.txt)"
PRURL="$(sed -rne 's,https?://github.com/[^/]+/[^/]+/pull/([0-9]+)$,\0,p' < pr_create_output.txt)"
else
echo "ERROR: Cannot create PR:"
cat pr_create_output.txt
fi
if [[ "${PRNUM}" -gt 1 ]]; then
gh pr ready "${NEXT_BRANCH}"
gh pr review "${NEXT_BRANCH}" -a -b "${MERGE_BODY}" || true
if gh pr merge "${NEXT_BRANCH}" --admin -d -s -b "${MERGE_BODY}" -t "${MERGE_SUBJECT}"; then
git checkout main
git branch -d "${NEXT_BRANCH}"
echo "PR ${PRNUM} was merged via admin override. See: ${PRURL}."
else
gh pr merge "${NEXT_BRANCH}" --auto -d -s -b "${MERGE_BODY}" -t "${MERGE_SUBJECT}"
git checkout main
git branch -d "${NEXT_BRANCH}" || true
echo "PR ${PRNUM} cannot be merged via admin override."
echo "Please approve it at ${PRURL}."
fi
fi
fi