Skip to content

Commit 306fe4a

Browse files
authored
ci: Fix release publish script (#5436)
1 parent e96fdbe commit 306fe4a

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

scripts/lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77
set -euo pipefail
88

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

scripts/release/check_commit_metadata.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
set -euo pipefail
1616
# shellcheck source=scripts/lib.sh
17-
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
17+
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
1818

1919
from_ref=${1:-}
2020
to_ref=${2:-}

scripts/release/generate_release_notes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
set -euo pipefail
1515
# shellcheck source=scripts/lib.sh
16-
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
16+
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
1717

1818
old_version=
1919
new_version=

scripts/release/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
set -euo pipefail
2929
# shellcheck source=scripts/lib.sh
30-
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
30+
source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
3131

3232
if [[ "${CI:-}" == "" ]]; then
3333
error "This script must be run in CI"
@@ -110,7 +110,7 @@ fi
110110
source "$SCRIPT_DIR/release/check_commit_metadata.sh" "$old_tag" "$new_ref"
111111

112112
# Craft the release notes.
113-
release_notes="$(execrelative ./generate_release_notes.sh --old-version "$old_tag" --new-version "$new_tag" --ref "$new_ref")"
113+
release_notes="$(execrelative ./release/generate_release_notes.sh --old-version "$old_tag" --new-version "$new_tag" --ref "$new_ref")"
114114

115115
release_notes_file="$(mktemp)"
116116
echo "$release_notes" >"$release_notes_file"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy