4 ## @brief Create a new release
6 ## new-release.sh [option]...\n
8 ## -v \<a.b\> is a major.minor version number\n
9 ## -s \<c\> is the start hash number for a new major.minor release - if omitted, HEAD is used\n
10 ## -p \<d\> is the patch version if a major.minor.patch release is being created\n
11 ## -r Push the release to the repo. If omitted a test run is made (run from a temp. clone folder)\n
14 ## Will create a new release off the master branch, or will create a new
15 ## patch version off an existing major.minor release branch.
17 ## It is expected that the first line of NEWS is in the form "Geeqie \<a.b[.d]\>
22 printf '%s\n' "Directory .git does not exist"
26 if ! zenity --title="NEW RELEASE" --question --text "Edit the following files before running\n this script:\n\nNEWS\norg.geeqie.Geeqie.appdata.xml.in\n\nContinue?" --width=300
35 while getopts "v:s:p:hr" option; do
38 printf '%s\n%s\n%s\n%s\n%s\n' "-v <a.b> release major.minor e.g 1.9" "-s <c> start hash e.g. 728172681 (optional)" "-p <d> release patch version e.g. 2 for 1.6.2" "-r push to repo." "-h help"
41 v) version="$OPTARG" ;;
49 if [ "$start" ] && [ "$patch" ]
51 printf '%s\n' "Cannot have start-hash and patch number together"
55 if [ "$(printf '%s\n' "$version" | awk -F"." '{print NF-1}')" -ne 1 ]
57 printf '%s\n' "Version major.minor $version is not valid"
63 if ! git branch master --contains "$start" > /dev/null 2>&1
65 printf '%s\n' "Start hash is not in master branch"
72 if ! git rev-parse "v$version" > /dev/null 2>&1
74 printf '%s\n' "Version $version does not exist"
78 if ! [ "$patch" -ge 0 ] 2>/dev/null
80 printf '%s\n' "Patch $patch is not an integer"
84 if git rev-parse "v$version" > /dev/null 2>&1
86 printf '%s\n' "Version $version already exists"
95 revision="$version.$patch"
102 git checkout -b stable/"$version"
104 git checkout -b stable/"$version" "$start"
109 git push git@geeqie.org:geeqie stable/"$version"
112 git checkout stable/"$version"
115 sudo make maintainer-clean
118 ./scripts/generate-man-page.sh
121 git add org.geeqie.Geeqie.appdata.xml.in
123 git add doc/docbook/CommandLineOptions.xml
124 git commit --message="Preparing for release v$revision"
128 git push git@geeqie.org:geeqie
131 git tag --sign "v$revision" --message="Release v$revision"
135 git push git@geeqie.org:geeqie "v$revision"
138 sudo make maintainer-clean
141 rm -rf /tmp/geeqie-"$revision".tar.xz
142 rm -rf /tmp/geeqie-"$revision".tar.xz.asc
144 # shellcheck disable=SC2140
145 tar --create --xz --file=/tmp/geeqie-"$revision".tar.xz --exclude=".git" --exclude="configure" --exclude="web" --transform s/"\bgeeqie\b"/"geeqie-$revision"/ ../geeqie
146 gpg --armor --detach-sign --output /tmp/geeqie-"$revision".tar.xz.asc /tmp/geeqie-"$revision".tar.xz
150 git checkout stable/"$version" NEWS
151 git checkout stable/"$version" geeqie.1
152 git checkout stable/"$version" doc/docbook/CommandLineOptions.xml
153 git checkout stable/"$version" org.geeqie.Geeqie.appdata.xml.in
156 git add org.geeqie.Geeqie.appdata.xml.in
158 git add doc/docbook/CommandLineOptions.xml
159 git commit --message="Release v$revision files"
163 git push git@geeqie.org:geeqie
166 zenity --info --window-icon="info" --text="Upload files:\n\n/tmp/geeqie-$revision.tar.xz\n/tmp/geeqie-$revision.tar.xz.asc\n\nto https://github.com/BestImageViewer/geeqie/releases" --width=400