77# decides a version -- the caller has already bumped whatever holds it and
88# committed that, so this tags what is in front of it.
99#
10- # create-release.sh --tag v1.2.3 --notes-file notes.md -- artifact dist/app.zip
10+ # create-release.sh --tag v1.2.3 --artifact dist/app.zip
1111#
1212# Authentication is not handled here. The caller is expected to have gh
1313# authenticated already -- in CI that is GH_TOKEN, locally it is your own
@@ -17,7 +17,6 @@ set -euo pipefail
1717
1818TAG=" "
1919TITLE=" "
20- NOTES_FILE=" "
2120TARGET=" "
2221DRY_RUN=" false"
2322GENERATE_NOTES=" true"
@@ -30,7 +29,6 @@ create-release.sh -- tag a commit and open a draft GitHub release
3029Options:
3130 --tag NAME tag to create, e.g. v1.2.3 (required)
3231 --title TEXT release title (default: the tag)
33- --notes-file FILE Markdown prepended to the generated notes
3432 --target SHA commit to tag (default: HEAD)
3533 --artifact PATH file to attach, repeatable
3634 --no-generate-notes omit GitHub's commit-derived notes
@@ -43,7 +41,6 @@ while [ $# -gt 0 ]; do
4341 case " $1 " in
4442 --tag) TAG=" $2 " ; shift 2 ;;
4543 --title) TITLE=" $2 " ; shift 2 ;;
46- --notes-file) NOTES_FILE=" $2 " ; shift 2 ;;
4744 --target) TARGET=" $2 " ; shift 2 ;;
4845 --artifact) ARTIFACTS+=(" $2 " ); shift 2 ;;
4946 --no-generate-notes) GENERATE_NOTES=" false" ; shift ;;
@@ -59,11 +56,6 @@ command -v gh >/dev/null || { echo "create-release: gh is not installed" >&2; ex
5956[ -n " $TITLE " ] || TITLE=" $TAG "
6057[ -n " $TARGET " ] || TARGET=" $( git rev-parse HEAD) "
6158
62- if [ -n " $NOTES_FILE " ] && [ ! -f " $NOTES_FILE " ]; then
63- echo " create-release: no such file: $NOTES_FILE " >&2
64- exit 1
65- fi
66-
6759# An empty or missing artifact means the build silently produced nothing, which
6860# is the failure worth catching -- a release with no files looks fine until
6961# someone tries to download one.
8375
8476declare -a ARGS=(" $TAG " --draft --title " $TITLE " --target " $TARGET " )
8577[ " $GENERATE_NOTES " = " true" ] && ARGS+=(--generate-notes)
86- [ -n " $NOTES_FILE " ] && ARGS+=(--notes-file " $NOTES_FILE " )
8778for f in ${ARTIFACTS[@]+" ${ARTIFACTS[@]} " } ; do ARGS+=(" $f " ); done
8879
8980echo " tag: $TAG "
0 commit comments