feat(webapp): correct version + commits (#9203)

This commit is contained in:
Ulf Gebhardt 2026-02-11 04:42:03 +01:00 committed by GitHub
parent 604de30fa2
commit 761305e333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 3 deletions

View File

@ -9,7 +9,7 @@
</span>
<!-- version -->
<a
href="https://github.com/Ocelot-Social-Community/Ocelot-Social/releases"
:href="`https://github.com/Ocelot-Social-Community/Ocelot-Social/releases/tag/${releaseTag}`"
target="_blank"
data-test="version-link"
>
@ -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],
}
},
}
</script>

View File

@ -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,