diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index daaa769..43487ba 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -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 diff --git a/tools/header.txt b/tools/header.txt index 9dfe50f..1e841de 100644 --- a/tools/header.txt +++ b/tools/header.txt @@ -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"); diff --git a/tools/trigger_release.sh b/tools/trigger_release.sh index 4b60324..b8c1036 100755 --- a/tools/trigger_release.sh +++ b/tools/trigger_release.sh @@ -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}' &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