Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 7521424

Browse files
authored
Merge pull request #1433 from mesosphere/create-gh-release-artifacts
build: Properly add asset files to github release
2 parents 2d128cf + 6af883f commit 7521424

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/create-gh-release.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21-
source "$(dirname "${BASH_SOURCE}")/util.sh"
21+
source "$(dirname "${BASH_SOURCE[0]}")/util.sh"
2222
ROOT_DIR="$(cd "$(dirname "$0")/.." ; pwd)"
2323

2424
# Arguments
@@ -51,7 +51,7 @@ function verify-assets-file-exists() {
5151

5252
function github-release-template() {
5353
# Add leading # for markdown heading level 1 (h1)
54-
local regex="$(echo ${RELEASE_TAG_REGEX/^/^\# })"
54+
local regex="${RELEASE_TAG_REGEX/^/^\# })"
5555
cat <<EOF
5656
${RELEASE_TAG}
5757
@@ -82,23 +82,23 @@ function create-github-release() {
8282
github-release-template > "${releaseFile}"
8383

8484
# Build asset attach arguments for gh release command
85-
local assetFiles
85+
local assetFiles=()
8686
for asset in $(cat "${RELEASE_ASSETS_FILE}"); do
87-
assetFiles+=" ${asset} "
87+
assetFiles+=("${asset}")
8888
done
8989

9090
# TODO(font): Add draft and prerelease options to this script.
91-
gh release create --draft --prerelease -F "${releaseFile}" "${RELEASE_TAG}" "${assetFiles}"
91+
gh release create --draft --prerelease -F "${releaseFile}" "${RELEASE_TAG}" "${assetFiles[@]}"
9292
}
9393

9494
# TODO(font): Consider performing this step BEFORE tagging and pushing a new
9595
# release so that the release tag contains all the necessary artifacts.
9696
function create-release-pr() {
97-
local commitFiles="${ROOT_DIR}/CHANGELOG.md ${ROOT_DIR}/charts/index.yaml"
97+
local commitFiles=("${ROOT_DIR}/CHANGELOG.md" "${ROOT_DIR}/charts/index.yaml")
9898

9999
# Use the origin and upstream git remote convention names used by gh.
100100
git checkout -b "${RELEASE_TAG}-rel" --no-track "${GITHUB_REMOTE_UPSTREAM_NAME}/master"
101-
git commit ${commitFiles} -m "Update repo for release ${RELEASE_TAG}"
101+
git commit "${commitFiles[@]}" -m "Update repo for release ${RELEASE_TAG}"
102102
git push --set-upstream "${GITHUB_REMOTE_FORK_NAME}" "${RELEASE_TAG}-rel"
103103
PR_URL="$(gh pr create --base "${GITHUB_PR_BASE_BRANCH}" --title "Update repo for release ${RELEASE_TAG}" -b "" --fill)"
104104

0 commit comments

Comments
 (0)