2016-10-14 13:15:32 +03:00
|
|
|
#!/bin/bash
|
2019-12-22 23:45:42 +03:00
|
|
|
set -Eeuo pipefail
|
2016-10-14 13:31:51 +03:00
|
|
|
|
2019-12-22 23:45:42 +03:00
|
|
|
readonly is_snapshot=${is_snapshot:?"true or false"}
|
2020-11-20 10:19:28 +03:00
|
|
|
marketing_version=${marketing_version:-""}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
if [[ "${is_snapshot}" == false && -z "${marketing_version}" ]]; then
|
2022-03-12 22:24:21 +03:00
|
|
|
echo "When no snapshot, you have to set 'marketing_version', eg v0.38.1"
|
2021-12-13 20:47:02 +03:00
|
|
|
|
|
|
|
if [[ "${marketing_version}" =~ ^v.* ]]; then
|
|
|
|
echo "### marketing_version must not begin with v!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "### Setting versions of VimR"
|
|
|
|
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
|
2016-10-14 13:15:32 +03:00
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
local bundle_version
|
|
|
|
bundle_version="$(date "+%Y%m%d.%H%M%S")"
|
|
|
|
readonly bundle_version
|
2016-10-15 00:55:38 +03:00
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
if [[ "${is_snapshot}" == true ]]; then
|
2019-12-22 23:45:42 +03:00
|
|
|
marketing_version="SNAPSHOT-${bundle_version}"
|
|
|
|
fi
|
2016-10-14 13:15:32 +03:00
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
pushd VimR >/dev/null
|
|
|
|
agvtool new-version -all "${bundle_version}"
|
|
|
|
agvtool new-marketing-version "${marketing_version}"
|
|
|
|
popd >/dev/null
|
2017-12-03 11:59:15 +03:00
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
popd >/dev/null
|
|
|
|
echo "### Set versions of VimR"
|
2021-12-13 20:47:02 +03:00
|
|
|
|
|
|
|
local tag
|
2022-03-24 20:08:11 +03:00
|
|
|
local github_release_name
|
|
|
|
local version_marker
|
2021-12-13 20:47:02 +03:00
|
|
|
if [[ "${is_snapshot}" == true ]]; then
|
2022-03-12 22:24:21 +03:00
|
|
|
tag="snapshot/${bundle_version}"
|
2022-03-24 20:08:11 +03:00
|
|
|
github_release_name="${marketing_version}"
|
|
|
|
version_marker="snapshot"
|
2021-12-13 20:47:02 +03:00
|
|
|
else
|
2022-03-12 22:24:21 +03:00
|
|
|
tag="v${marketing_version}-${bundle_version}"
|
2022-03-24 20:08:11 +03:00
|
|
|
github_release_name="$tag"
|
|
|
|
version_marker="release"
|
2022-04-16 19:44:30 +03:00
|
|
|
marketing_version="v${marketing_version}"
|
2021-12-13 20:47:02 +03:00
|
|
|
fi
|
2022-03-24 20:08:11 +03:00
|
|
|
readonly tag
|
|
|
|
readonly github_release_name
|
|
|
|
readonly version_marker
|
2022-04-16 19:44:30 +03:00
|
|
|
readonly marketing_version
|
2022-03-24 20:08:11 +03:00
|
|
|
|
|
|
|
local output
|
|
|
|
output=$(cat <<-END
|
|
|
|
declare -r -x is_snapshot=${is_snapshot}
|
|
|
|
declare -r -x bundle_version=${bundle_version}
|
|
|
|
declare -r -x marketing_version=${marketing_version}
|
|
|
|
declare -r -x tag=${tag}
|
|
|
|
declare -r -x github_release_name=${github_release_name}
|
2022-06-16 16:51:12 +03:00
|
|
|
declare -r -x release_notes=\$(cat release-notes.temp.md)
|
|
|
|
|
|
|
|
# Add release notes to release-notes.temp.md and issue
|
2023-11-22 15:47:59 +03:00
|
|
|
create_gh_release=true upload=true update_appcast=true release_spec_file=${bundle_version}-${version_marker}.sh ./bin/build_release.sh
|
2022-03-24 20:08:11 +03:00
|
|
|
END
|
|
|
|
)
|
|
|
|
readonly output
|
|
|
|
|
2022-06-16 16:51:12 +03:00
|
|
|
echo "Release notes" > release-notes.temp.md
|
2022-03-24 20:08:11 +03:00
|
|
|
echo "${output}" > "${bundle_version}-${version_marker}.sh"
|
|
|
|
|
2023-11-22 15:47:59 +03:00
|
|
|
echo "### Tag, commit and push with ${tag}."
|
|
|
|
echo "Then, add release notes to release-notes.temp.md."
|
|
|
|
echo ""
|
2022-03-24 20:08:11 +03:00
|
|
|
echo "### Use the following to build a release:"
|
2023-11-22 15:47:59 +03:00
|
|
|
echo ""
|
2022-03-24 20:08:11 +03:00
|
|
|
echo "release_spec_file=${bundle_version}-${version_marker}.sh \\"
|
|
|
|
echo "create_gh_release=true upload=true update_appcast=true \\"
|
|
|
|
echo "./bin/build_release.sh"
|
2023-11-22 15:47:59 +03:00
|
|
|
echo ""
|
|
|
|
echo "OR do ${bundle_version}-${version_marker}.sh"
|
2020-11-20 10:19:28 +03:00
|
|
|
}
|
2017-12-03 11:59:15 +03:00
|
|
|
|
2020-11-20 10:19:28 +03:00
|
|
|
main
|