chore: identify version numbers using a git tag (#16652)
* chore: identify version numbers using a git tag - remove VERSION file - expose the `GIT_COMMIT`so that we can properly construct the web links when the user clicks the version number in Settings/About - some smaller cleanups and warning fixes Fixes #12349 * fix_: ci artifact version and use version scripts --------- Co-authored-by: Igor Sirotin <sirotin@status.im>
This commit is contained in:
parent
481350385e
commit
fe759f3599
17
Makefile
17
Makefile
|
@ -236,9 +236,8 @@ endif
|
||||||
NIM_PARAMS += --outdir:./bin
|
NIM_PARAMS += --outdir:./bin
|
||||||
|
|
||||||
# App version
|
# App version
|
||||||
VERSIONFILE=VERSION
|
DESKTOP_VERSION = $(shell ./scripts/version.sh)
|
||||||
DESKTOP_VERSION=`cat $(VERSIONFILE)`
|
STATUSGO_VERSION = $(shell cd vendor/status-go; make version)
|
||||||
STATUSGO_VERSION=`(cd vendor/status-go; git describe --tags --abbrev=0)`
|
|
||||||
NIM_PARAMS += -d:DESKTOP_VERSION="$(DESKTOP_VERSION)"
|
NIM_PARAMS += -d:DESKTOP_VERSION="$(DESKTOP_VERSION)"
|
||||||
NIM_PARAMS += -d:STATUSGO_VERSION="$(STATUSGO_VERSION)"
|
NIM_PARAMS += -d:STATUSGO_VERSION="$(STATUSGO_VERSION)"
|
||||||
|
|
||||||
|
@ -251,6 +250,16 @@ ifeq ($(OUTPUT_CSV), true)
|
||||||
$(shell touch .update.timestamp)
|
$(shell touch .update.timestamp)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
##
|
||||||
|
## Versioning
|
||||||
|
##
|
||||||
|
|
||||||
|
version:
|
||||||
|
@echo $(DESKTOP_VERSION)
|
||||||
|
|
||||||
|
status-go-version:
|
||||||
|
@echo $(STATUSGO_VERSION)
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## StatusQ
|
## StatusQ
|
||||||
|
@ -781,7 +790,7 @@ endif
|
||||||
ISCC \
|
ISCC \
|
||||||
-O"$(INSTALLER_OUTPUT)" \
|
-O"$(INSTALLER_OUTPUT)" \
|
||||||
-D"BaseName=$(shell basename $(STATUS_CLIENT_EXE) .exe)" \
|
-D"BaseName=$(shell basename $(STATUS_CLIENT_EXE) .exe)" \
|
||||||
-D"Version=$(shell cat VERSION)" \
|
-D"Version=$(DESKTOP_VERSION)" \
|
||||||
$(OUTPUT)/status.iss
|
$(OUTPUT)/status.iss
|
||||||
ifdef WINDOWS_CODESIGN_PFX_PATH
|
ifdef WINDOWS_CODESIGN_PFX_PATH
|
||||||
scripts/sign-windows-bin.sh $(INSTALLER_OUTPUT)
|
scripts/sign-windows-bin.sh $(INSTALLER_OUTPUT)
|
||||||
|
|
|
@ -69,8 +69,9 @@ pipeline {
|
||||||
/* Avoid weird bugs caused by stale cache. */
|
/* Avoid weird bugs caused by stale cache. */
|
||||||
QML_DISABLE_DISK_CACHE = "true"
|
QML_DISABLE_DISK_CACHE = "true"
|
||||||
/* Control output the filename */
|
/* Control output the filename */
|
||||||
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage', arch: getArch())}"
|
VERSION = sh(script: "./scripts/version.sh", returnStdout: true)
|
||||||
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz', arch: getArch())}"
|
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage', arch: getArch(), version: env.VERSION)}"
|
||||||
|
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz', arch: getArch(), version: env.VERSION)}"
|
||||||
/* prevent sharing cache dir across different jobs */
|
/* prevent sharing cache dir across different jobs */
|
||||||
GO_GENERATE_FAST_DIR = "${env.WORKSPACE_TMP}/go-generate-fast"
|
GO_GENERATE_FAST_DIR = "${env.WORKSPACE_TMP}/go-generate-fast"
|
||||||
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
||||||
|
|
|
@ -61,8 +61,9 @@ pipeline {
|
||||||
/* Avoid weird bugs caused by stale cache. */
|
/* Avoid weird bugs caused by stale cache. */
|
||||||
QML_DISABLE_DISK_CACHE = "true"
|
QML_DISABLE_DISK_CACHE = "true"
|
||||||
/* Control output the filename */
|
/* Control output the filename */
|
||||||
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'nix.AppImage', arch: getArch())}"
|
VERSION = sh(script: "./scripts/version.sh", returnStdout: true)
|
||||||
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'nix.tar.gz', arch: getArch())}"
|
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'nix.AppImage', arch: getArch(), version: env.VERSION)}"
|
||||||
|
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'nix.tar.gz', arch: getArch(), version: env.VERSION)}"
|
||||||
/* prevent sharing cache dir across different jobs */
|
/* prevent sharing cache dir across different jobs */
|
||||||
GO_GENERATE_FAST_DIR = "${env.WORKSPACE_TMP}/go-generate-fast"
|
GO_GENERATE_FAST_DIR = "${env.WORKSPACE_TMP}/go-generate-fast"
|
||||||
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
SENTRY_PRODUCTION = "${utils.isReleaseBuild() ? 'true' : 'false'}"
|
||||||
|
|
|
@ -72,7 +72,8 @@ pipeline {
|
||||||
/* Avoid weird bugs caused by stale cache. */
|
/* Avoid weird bugs caused by stale cache. */
|
||||||
QML_DISABLE_DISK_CACHE = "true"
|
QML_DISABLE_DISK_CACHE = "true"
|
||||||
/* Control output the filename */
|
/* Control output the filename */
|
||||||
STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg', arch: getArch())}"
|
VERSION = sh(script: "./scripts/version.sh", returnStdout: true)
|
||||||
|
STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg', arch: getArch(), version: env.VERSION)}"
|
||||||
/* Apple Team ID for Notarization */
|
/* Apple Team ID for Notarization */
|
||||||
MACOS_NOTARIZE_TEAM_ID = "8B5X2M6H2Y"
|
MACOS_NOTARIZE_TEAM_ID = "8B5X2M6H2Y"
|
||||||
/* prevent sharing cache dir across different jobs */
|
/* prevent sharing cache dir across different jobs */
|
||||||
|
|
|
@ -74,9 +74,10 @@ pipeline {
|
||||||
/* Avoid weird bugs caused by stale cache. */
|
/* Avoid weird bugs caused by stale cache. */
|
||||||
QML_DISABLE_DISK_CACHE = "true"
|
QML_DISABLE_DISK_CACHE = "true"
|
||||||
/* Control output the filename */
|
/* Control output the filename */
|
||||||
STATUS_CLIENT_EXE = "pkg/${utils.pkgFilename(ext: 'exe', arch: getArch())}"
|
VERSION = sh(script: "./scripts/version.sh", returnStdout: true)
|
||||||
|
STATUS_CLIENT_EXE = "pkg/${utils.pkgFilename(ext: 'exe', arch: getArch(), version: env.VERSION)}"
|
||||||
/* 7zip archive filename */
|
/* 7zip archive filename */
|
||||||
STATUS_CLIENT_7Z = "pkg/${utils.pkgFilename(ext: '7z', arch: getArch())}"
|
STATUS_CLIENT_7Z = "pkg/${utils.pkgFilename(ext: '7z', arch: getArch(), version: env.VERSION)}"
|
||||||
/* Hack-fix for params not being set in env on first job run. */
|
/* Hack-fix for params not being set in env on first job run. */
|
||||||
WINDOWS_CODESIGN_TIMESTAMP_URL = "${params.WINDOWS_CODESIGN_TIMESTAMP_URL}"
|
WINDOWS_CODESIGN_TIMESTAMP_URL = "${params.WINDOWS_CODESIGN_TIMESTAMP_URL}"
|
||||||
/* prevent sharing cache dir across different jobs */
|
/* prevent sharing cache dir across different jobs */
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
git describe --tags --dirty="-dirty"
|
|
@ -27,13 +27,16 @@ proc init*(self: Controller) =
|
||||||
self.delegate.versionFetched(args.available, args.version, args.url)
|
self.delegate.versionFetched(args.available, args.version, args.url)
|
||||||
|
|
||||||
proc getAppVersion*(self: Controller): string =
|
proc getAppVersion*(self: Controller): string =
|
||||||
return self.aboutService.getAppVersion()
|
self.aboutService.getAppVersion()
|
||||||
|
|
||||||
|
proc getGitCommit*(self: Controller): string =
|
||||||
|
self.aboutService.getGitCommit()
|
||||||
|
|
||||||
proc checkForUpdates*(self: Controller) =
|
proc checkForUpdates*(self: Controller) =
|
||||||
self.aboutService.checkForUpdates()
|
self.aboutService.checkForUpdates()
|
||||||
|
|
||||||
proc getNodeVersion*(self: Controller): string =
|
proc getNodeVersion*(self: Controller): string =
|
||||||
return self.aboutService.getNodeVersion()
|
self.aboutService.getNodeVersion()
|
||||||
|
|
||||||
proc getStatusGoVersion*(self: Controller): string =
|
proc getStatusGoVersion*(self: Controller): string =
|
||||||
self.aboutService.getStatusGoVersion()
|
self.aboutService.getStatusGoVersion()
|
||||||
|
|
|
@ -14,6 +14,9 @@ method isLoaded*(self: AccessInterface): bool {.base.} =
|
||||||
method getAppVersion*(self: AccessInterface): string {.base.} =
|
method getAppVersion*(self: AccessInterface): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method getGitCommit*(self: AccessInterface): string {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getNodeVersion*(self: AccessInterface): string {.base.} =
|
method getNodeVersion*(self: AccessInterface): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@ method viewDidLoad*(self: Module) =
|
||||||
method getAppVersion*(self: Module): string =
|
method getAppVersion*(self: Module): string =
|
||||||
return self.controller.getAppVersion()
|
return self.controller.getAppVersion()
|
||||||
|
|
||||||
|
method getGitCommit*(self: Module): string =
|
||||||
|
return self.controller.getGitCommit()
|
||||||
|
|
||||||
method getNodeVersion*(self: Module): string =
|
method getNodeVersion*(self: Module): string =
|
||||||
return self.controller.getNodeVersion()
|
return self.controller.getNodeVersion()
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,9 @@ QtObject:
|
||||||
proc getCurrentVersion*(self: View): string {.slot.} =
|
proc getCurrentVersion*(self: View): string {.slot.} =
|
||||||
return self.delegate.getAppVersion()
|
return self.delegate.getAppVersion()
|
||||||
|
|
||||||
|
proc getGitCommit*(self: View): string {.slot.} =
|
||||||
|
return self.delegate.getGitCommit()
|
||||||
|
|
||||||
proc nodeVersion*(self: View): string {.slot.} =
|
proc nodeVersion*(self: View): string {.slot.} =
|
||||||
return self.delegate.getNodeVersion()
|
return self.delegate.getNodeVersion()
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,9 @@ QtObject:
|
||||||
proc getAppVersion*(self: Service): string =
|
proc getAppVersion*(self: Service): string =
|
||||||
return APP_VERSION
|
return APP_VERSION
|
||||||
|
|
||||||
|
proc getGitCommit*(self: Service): string =
|
||||||
|
return GIT_COMMIT
|
||||||
|
|
||||||
proc getNodeVersion*(self: Service): string =
|
proc getNodeVersion*(self: Service): string =
|
||||||
try:
|
try:
|
||||||
return backend.clientVersion().result.getStr
|
return backend.clientVersion().result.getStr
|
||||||
|
|
|
@ -12,7 +12,7 @@ const STATUSGO_VERSION* {.strdefine.} = "0.0.0"
|
||||||
# This is changed during compilation by executing git command
|
# This is changed during compilation by executing git command
|
||||||
const GIT_COMMIT* {.strdefine.} = ""
|
const GIT_COMMIT* {.strdefine.} = ""
|
||||||
|
|
||||||
const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("{GIT_COMMIT}")
|
const APP_VERSION* = DESKTOP_VERSION
|
||||||
|
|
||||||
const sep* = when defined(windows): "\\" else: "/"
|
const sep* = when defined(windows): "\\" else: "/"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import os, sequtils, strutils, stew/shims/strformat, chronicles
|
import os, sequtils, strutils, chronicles
|
||||||
|
|
||||||
import app/global/feature_flags
|
import app/global/feature_flags
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,17 @@ SplitView {
|
||||||
|
|
||||||
function getCurrentVersion() {
|
function getCurrentVersion() {
|
||||||
logs.logEvent("store::getCurrentVersion")
|
logs.logEvent("store::getCurrentVersion")
|
||||||
return isProduction ? "0.13.2" : "45784cf0c"
|
return isProduction ? "0.13.2" : "0.13.2-dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGitCommit() {
|
||||||
|
logs.logEvent("store::getGitCommit")
|
||||||
|
return "92b88e8a3e1d48f2c39d1db6e4d577ebbe21f7a9"
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStatusGoVersion() {
|
function getStatusGoVersion() {
|
||||||
logs.logEvent("store::getStatusGoVersion")
|
logs.logEvent("store::getStatusGoVersion")
|
||||||
return "0.162.9"
|
return "v0.162.9"
|
||||||
}
|
}
|
||||||
|
|
||||||
function qtRuntimeVersion() {
|
function qtRuntimeVersion() {
|
||||||
|
@ -44,10 +49,10 @@ SplitView {
|
||||||
|
|
||||||
function getReleaseNotes() {
|
function getReleaseNotes() {
|
||||||
logs.logEvent("store::getReleaseNotes")
|
logs.logEvent("store::getReleaseNotes")
|
||||||
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1" :
|
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1".arg(getCurrentVersion()) :
|
||||||
"https://github.com/status-im/status-desktop/commit/%1"
|
"https://github.com/status-im/status-desktop/commit/%1".arg(getGitCommit())
|
||||||
|
|
||||||
openLink(link.arg(getCurrentVersion()))
|
openLink(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
function openLink(url) {
|
function openLink(url) {
|
||||||
|
|
|
@ -405,6 +405,10 @@ StatusSectionLayout {
|
||||||
return root.store.getCurrentVersion()
|
return root.store.getCurrentVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGitCommit() {
|
||||||
|
return root.store.getGitCommit()
|
||||||
|
}
|
||||||
|
|
||||||
function getStatusGoVersion() {
|
function getStatusGoVersion() {
|
||||||
return root.store.getStatusGoVersion()
|
return root.store.getStatusGoVersion()
|
||||||
}
|
}
|
||||||
|
@ -414,10 +418,10 @@ StatusSectionLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReleaseNotes() {
|
function getReleaseNotes() {
|
||||||
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1" :
|
const link = isProduction ? "https://github.com/status-im/status-desktop/releases/tag/%1".arg(getCurrentVersion()) :
|
||||||
"https://github.com/status-im/status-desktop/commit/%1"
|
"https://github.com/status-im/status-desktop/commit/%1".arg(getGitCommit())
|
||||||
|
|
||||||
openLink(link.arg(getCurrentVersion()))
|
openLink(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
function openLink(url) {
|
function openLink(url) {
|
||||||
|
|
|
@ -133,7 +133,11 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentVersion() {
|
function getCurrentVersion() {
|
||||||
return aboutModuleInst.getCurrentVersion()
|
return aboutModuleInst.getCurrentVersion().replace(/^v/, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGitCommit() {
|
||||||
|
return aboutModuleInst.getGitCommit()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStatusGoVersion() {
|
function getStatusGoVersion() {
|
||||||
|
|
|
@ -68,7 +68,7 @@ SettingsContentBase {
|
||||||
font.pixelSize: 22
|
font.pixelSize: 22
|
||||||
font.bold: true
|
font.bold: true
|
||||||
normalColor: Theme.palette.directColor1
|
normalColor: Theme.palette.directColor1
|
||||||
text: (root.store.isProduction ? "" : "git:") + root.store.getCurrentVersion()
|
text: root.store.getCurrentVersion()
|
||||||
onClicked: root.store.getReleaseNotes()
|
onClicked: root.store.getReleaseNotes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ SettingsContentBase {
|
||||||
font.pixelSize: 17
|
font.pixelSize: 17
|
||||||
font.bold: true
|
font.bold: true
|
||||||
normalColor: Theme.palette.directColor1
|
normalColor: Theme.palette.directColor1
|
||||||
text: root.store.getStatusGoVersion()
|
text: root.store.getStatusGoVersion().replace(/^v/, '')
|
||||||
onClicked: root.store.openLink("https://github.com/status-im/status-go/tree/%1".arg(root.store.getStatusGoVersion()))
|
onClicked: root.store.openLink("https://github.com/status-im/status-go/tree/%1".arg(root.store.getStatusGoVersion()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ OTHER_FILES += $$files("$$PWD/../vendor/SortFilterProxyModel/*.h", true)
|
||||||
|
|
||||||
OTHER_FILES += $$files("$$PWD/../vendor/nimqml/src/*.nim", true)
|
OTHER_FILES += $$files("$$PWD/../vendor/nimqml/src/*.nim", true)
|
||||||
|
|
||||||
|
OTHER_FILES += $$files("$$PWD/../Makefile")
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH = $$PWD/imports \
|
QML_IMPORT_PATH = $$PWD/imports \
|
||||||
$$PWD/StatusQ \
|
$$PWD/StatusQ \
|
||||||
|
@ -49,9 +51,4 @@ QML_IMPORT_PATH = $$PWD/imports \
|
||||||
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
QML_DESIGNER_IMPORT_PATH = $$PWD/imports
|
QML_DESIGNER_IMPORT_PATH = $$PWD/imports
|
||||||
|
|
||||||
# Default rules for deployment.
|
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|
||||||
!isEmpty(target.path): INSTALLS += target
|
|
||||||
|
|
||||||
RESOURCES += resources.qrc StatusQ/src/assets.qrc StatusQ/src/statusq.qrc
|
RESOURCES += resources.qrc StatusQ/src/assets.qrc StatusQ/src/statusq.qrc
|
||||||
|
|
Loading…
Reference in New Issue