release.sh: don't hardcode ".0" suffix in APK_VERSION
does not work with current beta: ``` d142c5534f4da4a7f0a1f52676716908f674ff9e06b87f7b153384b161296eaf /home/user/wspace/electrum/contrib/android/../../dist/Electrum-4.5.0.0-armeabi-v7a-release-unsigned.apk + mv dist/Electrum-4.5.0b0.0-armeabi-v7a-release-unsigned.apk dist/Electrum-4.5.0b0.0-armeabi-v7a-release.apk mv: cannot stat 'dist/Electrum-4.5.0b0.0-armeabi-v7a-release-unsigned.apk': No such file or directory ```
This commit is contained in:
@@ -1,15 +1,25 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# For usage in shell, to get the version of electrum, without needing electrum installed.
|
# For usage in shell, to get the version of electrum, without needing electrum installed.
|
||||||
|
# usage: ./print_electrum_version.py [<attr_name>]
|
||||||
|
#
|
||||||
# For example:
|
# For example:
|
||||||
# $ VERSION=$("$CONTRIB"/print_electrum_version.py)
|
# $ VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||||
|
# $ VERSION=$("$CONTRIB"/print_electrum_version.py APK_VERSION)
|
||||||
# instead of
|
# instead of
|
||||||
# $ VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
# $ VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||||
|
# $ VERSION=$(python3 -c "import electrum; print(electrum.version.APK_VERSION)")
|
||||||
|
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) >= 2:
|
||||||
|
attr_name = sys.argv[1]
|
||||||
|
else:
|
||||||
|
attr_name = "ELECTRUM_VERSION"
|
||||||
|
|
||||||
project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
version_file_path = os.path.join(project_root, "electrum", "version.py")
|
version_file_path = os.path.join(project_root, "electrum", "version.py")
|
||||||
|
|
||||||
@@ -18,5 +28,6 @@ if __name__ == '__main__':
|
|||||||
version_module = version = importlib.util.module_from_spec(version_spec)
|
version_module = version = importlib.util.module_from_spec(version_spec)
|
||||||
version_spec.loader.exec_module(version_module)
|
version_spec.loader.exec_module(version_module)
|
||||||
|
|
||||||
print(version.ELECTRUM_VERSION)
|
attr_val = getattr(version, attr_name)
|
||||||
|
print(attr_val, file=sys.stdout)
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
VERSION=$("$CONTRIB"/print_electrum_version.py)
|
VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||||
|
APK_VERSION=$("$CONTRIB"/print_electrum_version.py APK_VERSION)
|
||||||
info "VERSION: $VERSION"
|
info "VERSION: $VERSION"
|
||||||
|
info "APK_VERSION: $APK_VERSION"
|
||||||
REV=$(git describe --tags)
|
REV=$(git describe --tags)
|
||||||
info "REV: $REV"
|
info "REV: $REV"
|
||||||
COMMIT=$(git rev-parse HEAD)
|
COMMIT=$(git rev-parse HEAD)
|
||||||
@@ -147,8 +149,8 @@ fi
|
|||||||
# android
|
# android
|
||||||
for arch in armeabi-v7a arm64-v8a x86_64
|
for arch in armeabi-v7a arm64-v8a x86_64
|
||||||
do
|
do
|
||||||
apk="Electrum-$VERSION.0-$arch-release.apk"
|
apk="Electrum-$APK_VERSION-$arch-release.apk"
|
||||||
apk_unsigned="Electrum-$VERSION.0-$arch-release-unsigned.apk"
|
apk_unsigned="Electrum-$APK_VERSION-$arch-release-unsigned.apk"
|
||||||
if test -f "dist/$apk"; then
|
if test -f "dist/$apk"; then
|
||||||
info "file exists: $apk"
|
info "file exists: $apk"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user