Skip to content

Commit

Permalink
chore: identify version numbers using a git tag
Browse files Browse the repository at this point in the history
- remove VERSION file
- some smaller cleanups and warning fixes

Fixes #12349
  • Loading branch information
caybro committed Oct 29, 2024
1 parent ab92672 commit 1eb40e4
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ endif
NIM_PARAMS += --outdir:./bin

# App version
VERSIONFILE=VERSION
DESKTOP_VERSION=`cat $(VERSIONFILE)`
DESKTOP_VERSION=`git describe --tags`
STATUSGO_VERSION=`(cd vendor/status-go; git describe --tags --abbrev=0)`
NIM_PARAMS += -d:DESKTOP_VERSION="$(DESKTOP_VERSION)"
NIM_PARAMS += -d:STATUSGO_VERSION="$(STATUSGO_VERSION)"
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion src/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const STATUSGO_VERSION* {.strdefine.} = "0.0.0"
# This is changed during compilation by executing git command
const GIT_COMMIT* {.strdefine.} = ""

const APP_VERSION* = if defined(production): DESKTOP_VERSION else: fmt("{GIT_COMMIT}")
const APP_VERSION* = if defined(production): DESKTOP_VERSION else: DESKTOP_VERSION % "-" % GIT_COMMIT

const sep* = when defined(windows): "\\" else: "/"

Expand Down
2 changes: 1 addition & 1 deletion src/env_cli_vars.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, sequtils, strutils, stew/shims/strformat, chronicles
import os, sequtils, strutils, chronicles

import app/global/feature_flags

Expand Down
2 changes: 1 addition & 1 deletion src/nim_status_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ proc determineStatusAppIconPath(): string =
if defined(production):
return "/../status.png"

return "/../status-dev.png"
return "/../status-dev.png"

proc prepareLogging() =
# Outputs logs in the node tab
Expand Down
2 changes: 1 addition & 1 deletion storybook/pages/AboutViewPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SplitView {

function getCurrentVersion() {
logs.logEvent("store::getCurrentVersion")
return isProduction ? "0.13.2" : "45784cf0c"
return isProduction ? "v0.13.2" : "v0.13.2-dev"
}

function getStatusGoVersion() {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Profile/views/AboutView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ SettingsContentBase {
font.pixelSize: 22
font.bold: true
normalColor: Theme.palette.directColor1
text: (root.store.isProduction ? "" : "git:") + root.store.getCurrentVersion()
text: root.store.getCurrentVersion().replace(/^v/, '')
onClicked: root.store.getReleaseNotes()
}

Expand Down
7 changes: 2 additions & 5 deletions ui/nim-status-client.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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/../Makefile")

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = $$PWD/imports \
$$PWD/StatusQ \
Expand All @@ -49,9 +51,4 @@ QML_IMPORT_PATH = $$PWD/imports \
# Additional import path used to resolve QML modules just for Qt Quick Designer
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

0 comments on commit 1eb40e4

Please sign in to comment.