ci: Fix release publish script (#5436)

This commit is contained in:
Mathias Fredriksson 2022-12-15 16:31:57 +02:00 committed by GitHub
parent e96fdbed26
commit 306fe4a91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,15 @@
set -euo pipefail
# Avoid sourcing this script multiple times to guard against when lib.sh
# is used by another sourced script, it can lead to confusing results.
if [[ ${SCRIPTS_LIB_IS_SOURCED:-0} == 1 ]]; then
return
fi
# Do not export to avoid this value being inherited by non-sourced
# scripts.
SCRIPTS_LIB_IS_SOURCED=1
# realpath returns an absolute path to the given relative path. It will fail if
# the parent directory of the path does not exist. Make sure you are in the
# expected directory before running this to avoid errors.

View File

@ -14,7 +14,7 @@
set -euo pipefail
# shellcheck source=scripts/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
from_ref=${1:-}
to_ref=${2:-}

View File

@ -13,7 +13,7 @@
set -euo pipefail
# shellcheck source=scripts/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
old_version=
new_version=

View File

@ -27,7 +27,7 @@
set -euo pipefail
# shellcheck source=scripts/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
if [[ "${CI:-}" == "" ]]; then
error "This script must be run in CI"
@ -110,7 +110,7 @@ fi
source "$SCRIPT_DIR/release/check_commit_metadata.sh" "$old_tag" "$new_ref"
# Craft the release notes.
release_notes="$(execrelative ./generate_release_notes.sh --old-version "$old_tag" --new-version "$new_tag" --ref "$new_ref")"
release_notes="$(execrelative ./release/generate_release_notes.sh --old-version "$old_tag" --new-version "$new_tag" --ref "$new_ref")"
release_notes_file="$(mktemp)"
echo "$release_notes" >"$release_notes_file"