From 761305e33376d0ec383e9756bdfd09603df21daf Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 11 Feb 2026 04:42:03 +0100 Subject: [PATCH] feat(webapp): correct version + commits (#9203) --- webapp/components/PageFooter/PageFooter.vue | 9 +++++++-- webapp/config/index.js | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/webapp/components/PageFooter/PageFooter.vue b/webapp/components/PageFooter/PageFooter.vue index f17bf5fa5..ac8962d53 100644 --- a/webapp/components/PageFooter/PageFooter.vue +++ b/webapp/components/PageFooter/PageFooter.vue @@ -9,7 +9,7 @@ @@ -33,7 +33,12 @@ export default { }, }, data() { - return { links, version: `v${this.$env.VERSION}` } + const version = this.$env.VERSION + return { + links, + version: `v${version}`, + releaseTag: version.split('+')[0], + } }, } diff --git a/webapp/config/index.js b/webapp/config/index.js index 50fb17d03..da1720a03 100644 --- a/webapp/config/index.js +++ b/webapp/config/index.js @@ -6,6 +6,22 @@ dotenv.config() // we want to synchronize @nuxt-dotenv and nuxt-env // Load Package Details for some default values const pkg = require('../package') +// Build version from git describe (e.g. "3.14.0-12-gabcdef" → "3.14.0+12") +const BUILD_VERSION = (() => { + try { + const desc = require('child_process') + .execSync('git describe --tags --match "[0-9]*"', { + encoding: 'utf8', + stdio: ['pipe', 'pipe', 'ignore'], + }) + .trim() + const match = desc.match(/^(.+)-(\d+)-g[0-9a-f]+$/) + return match ? `${match[1]}+${match[2]}` : desc + } catch { + return null + } +})() + const environment = { NODE_ENV: process.env.NODE_ENV, DEBUG: process.env.NODE_ENV !== 'production' || false, @@ -25,7 +41,7 @@ const sentry = { } const options = { - VERSION: process.env.VERSION || pkg.version, + VERSION: process.env.VERSION || BUILD_VERSION || pkg.version, DESCRIPTION: process.env.DESCRIPTION || pkg.description, MAPBOX_TOKEN: process.env.MAPBOX_TOKEN, PUBLIC_REGISTRATION: process.env.PUBLIC_REGISTRATION === 'true' || false,