mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
chore(build): adjust version updating script to not rely on git
Relying on git doesn't work in awful lot of cases, e.g. when there's a shallow `git clone`. Instead have "hardcoded" version in files, and update it before release. Closes #4165.
This commit is contained in:
parent
08fdb7561e
commit
63e95f3528
|
@ -162,6 +162,8 @@ process, so that no translation effort would be lost when resetting Weblate.**
|
|||
- `PATCH` – bump when there have been only fixes added. If changes include
|
||||
something more than just bugfixes, bump `MAJOR` or `MINOR` version
|
||||
accordingly.
|
||||
- update version for windows/osx packages using [`./tools/update-versions.sh`]
|
||||
script
|
||||
- before creating a `MAJOR`/`MINOR` release generate changelog with `clog`.
|
||||
- in a `MAJOR`/`MINOR` release tag should include information that changelog
|
||||
is located in the `CHANGELOG.md` file, e.g. `For details see CHANGELOG.md`
|
||||
|
@ -196,3 +198,4 @@ helping for a while, ask to be added to the `qTox` organization on GitHub.
|
|||
[`test-pr.sh`]: /test-pr.sh
|
||||
[`./tools/deweblate-translation-file.sh`]: /tools/deweblate-translation-file.sh
|
||||
[`./tools/create-tarball.sh`]: /tools/create-tarball.sh
|
||||
[`./tools/update-versions.sh`]: /tools/update-versions.sh
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.7.0</string>
|
||||
<string>1.8.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>toxq</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.7.0</string>
|
||||
<string>1.8.1</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016 The qTox Project Contributors
|
||||
# Copyright © 2016-2017 The qTox Project Contributors
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -16,30 +16,48 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# script to append correct qTox version to `.plist` file from
|
||||
# `git describe`
|
||||
# script to change qTox version in `info.plist` file to the supplied one
|
||||
#
|
||||
# NOTE: it checkouts the files before appending a version to them!
|
||||
#
|
||||
# requires:
|
||||
# * correctly formatted `*.plist file(s) in working dir
|
||||
# * git – tags in format `v0.0.0`
|
||||
# * correctly formatted `info.plist file in working dir
|
||||
# * GNU sed
|
||||
|
||||
# usage:
|
||||
#
|
||||
# ./$script
|
||||
# ./$script $version
|
||||
#
|
||||
# $version has to be composed of at least one number/dot
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
# uses `get_version()`
|
||||
source "../tools/lib/git.source"
|
||||
|
||||
# append version to .plist file(s) after the right line
|
||||
# update version in `info.plist` file to supplied one after the right lines
|
||||
update_version() {
|
||||
local ver=$(get_version)
|
||||
defaults write "$(pwd)/info.plist" CFBundleVersion $ver
|
||||
defaults write "$(pwd)/info.plist" CFBundleShortVersionString $ver
|
||||
plutil -convert xml1 info.plist
|
||||
local vars=(
|
||||
' <key>CFBundleShortVersionString</key>'
|
||||
' <key>CFBundleVersion</key>'
|
||||
)
|
||||
|
||||
for v in "${vars[@]}"
|
||||
do
|
||||
sed -i -r "\\R$v\$R,+1 s,(<string>)[0-9\\.]+(</string>)$,\\1$@\\2," \
|
||||
"./info.plist"
|
||||
done
|
||||
}
|
||||
update_version
|
||||
|
||||
# exit if supplied arg is not a version
|
||||
is_version() {
|
||||
if [[ ! $@ =~ [0-9\\.]+ ]]
|
||||
then
|
||||
echo "Not a version: $@"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
is_version "$@"
|
||||
|
||||
update_version "$@"
|
||||
}
|
||||
main "$@"
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016 The qTox Project Contributors
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# source for scripts using git-based functionality
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
# Get numerical version from git tag, parts of version separated by dots
|
||||
# from e.g. `v123.456.789` get `123.456.789` part
|
||||
get_version() {
|
||||
git describe --abbrev=0 \
|
||||
| sed -e 's/^v//'
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016 The qTox Project Contributors
|
||||
# Copyright © 2016-2017 The qTox Project Contributors
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -16,19 +16,20 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# script to add versions to the files for osx and windows "packages"
|
||||
# script to change versions in the files for osx and windows "packages"
|
||||
#
|
||||
# it should be run by the `qTox-Mac-Deployer-ULTIMATE.sh`
|
||||
# it should be run before releasing a new version
|
||||
#
|
||||
# NOTE: it checkouts the files before appending a version to them!
|
||||
#
|
||||
# requires:
|
||||
# * git – tags in format `v0.0.0`
|
||||
# * GNU sed
|
||||
|
||||
# usage:
|
||||
#
|
||||
# ./$script
|
||||
# ./$script $version
|
||||
#
|
||||
# $version has to be composed of at least one number/dot
|
||||
|
||||
|
||||
set -eu -o pipefail
|
||||
|
@ -36,20 +37,34 @@ set -eu -o pipefail
|
|||
|
||||
update_windows() {
|
||||
( cd windows
|
||||
./qtox-nsi-version.sh )
|
||||
./qtox-nsi-version.sh "$@" )
|
||||
}
|
||||
|
||||
update_osx() {
|
||||
( cd osx
|
||||
./update-plist-version.sh )
|
||||
./update-plist-version.sh "$@" )
|
||||
}
|
||||
|
||||
# exit if supplied arg is not a version
|
||||
is_version() {
|
||||
if [[ ! $@ =~ [0-9\\.]+ ]]
|
||||
then
|
||||
echo "Not a version: $@"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
update_osx
|
||||
is_version "$@"
|
||||
|
||||
# osx cannot into proper sed
|
||||
if [[ ! "$OSTYPE" == "darwin"* ]]
|
||||
then
|
||||
update_windows
|
||||
update_osx "$@"
|
||||
update_windows "$@"
|
||||
else
|
||||
# TODO: actually check whether there is a GNU sed on osx
|
||||
echo "OSX's sed not supported. Get a proper one."
|
||||
fi
|
||||
}
|
||||
main
|
||||
main "$@"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright © 2016 Zetok Zalbavar <zetok@openmailbox.org>
|
||||
# Copyright © 2016-2017 Zetok Zalbavar <zetok@openmailbox.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -15,36 +15,42 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# script to append correct qTox version to `.nsi` files from
|
||||
# `git describe`
|
||||
#
|
||||
# NOTE: it checkouts the files before appending a version to them!
|
||||
|
||||
# script to change qTox version in `.nsi` files to supplied one
|
||||
#
|
||||
# requires:
|
||||
# * files `qtox.nsi` and `qtox64.nsi` in working dir
|
||||
# * git – tags in format `v0.0.0`
|
||||
# * GNU sed
|
||||
|
||||
# usage:
|
||||
#
|
||||
# ./$script
|
||||
# ./$script $version
|
||||
#
|
||||
# $version has to be composed of at least one number/dot
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
# uses `get_version()`
|
||||
source "../tools/lib/git.source"
|
||||
|
||||
|
||||
# append version to .nsi files after a certain line
|
||||
append_version() {
|
||||
local after_line=' ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox"'
|
||||
local append=' ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion"'
|
||||
|
||||
# change version in .nsi files in the right line
|
||||
change_version() {
|
||||
for nsi in *.nsi
|
||||
do
|
||||
git checkout "$nsi"
|
||||
sed -i "/$after_line/a\\$append \"$(get_version)\"" "$nsi"
|
||||
sed -i -r "/DisplayVersion/ s/\"[0-9\\.]+\"$/\"$@\"/" "$nsi"
|
||||
done
|
||||
}
|
||||
|
||||
append_version
|
||||
# exit if supplied arg is not a version
|
||||
is_version() {
|
||||
if [[ ! $@ =~ [0-9\\.]+ ]]
|
||||
then
|
||||
echo "Not a version: $@"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
is_version "$@"
|
||||
|
||||
change_version "$@"
|
||||
}
|
||||
main "$@"
|
||||
|
|
|
@ -281,6 +281,7 @@ Section "Install"
|
|||
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
|
||||
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.8.1"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "The qTox Project"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io"
|
||||
|
|
|
@ -281,6 +281,7 @@ Section "Install"
|
|||
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
|
||||
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.8.1"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "The qTox Project"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io"
|
||||
|
|
Loading…
Reference in New Issue
Block a user