echo "jellyfin-web branch ${web_branch} is invalid."
exit 1
}
popd
new_version="$1"
# Parse the version from the AssemblyVersion
old_version="$(
grep "AssemblyVersion" ${shared_version_file} \
| sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' \
| sed -E 's/.0$//'
)"
# Set the shared version to the specified new_version
old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' chars
sed -i "s/${old_version_sed}/${new_version}/g" ${shared_version_file}
declare -a pr_merges_since_last_master
declare changelog_string_github
declare changelog_string_deb
declare changelog_string_yum
# Build up a changelog from merge commits
for repo in ./ MediaBrowser.WebDashboard/jellyfin-web/; do
last_master_merge_commit=""
pr_merges_since_last_master=()
git_show_details=""
pull_request_id=""
pull_request_description=""
changelog_strings_repo_github=""
changelog_strings_repo_deb=""
changelog_strings_repo_yum=""
case $repo in
*jellyfin-web*)
repo_name="jellyfin-web"
;;
*)
repo_name="jellyfin"
;;
esac
pushd ${repo}
# Find the last release commit, so we know what's happened since
last_master_branch="master-${old_version}" # TODO: Set to `release-` for next release, so we can properly parse both repos with the new branch standard
last_master_merge_commit="$(
git log --merges --pretty=oneline \
| grep -F "${last_master_branch}" \
| awk '{ print $1 }' \
|| true # Don't die here with errexit
)"
if [[ -z ${last_master_merge_commit} ]]; then
# This repo has no last proper commit, so just skip it
popd
continue
fi
# Get all the PR merge commits since the last master merge commit in `jellyfin`