From 04048c18f06ee0463ef0b3954dfa1c6a3554c313 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 6 Feb 2025 16:42:14 +0700 Subject: [PATCH] Remove 0.7 tagTime versioning Signed-off-by: Andrey Sobolev --- .github/workflows/main.yml | 1 - common/scripts/show_version.js | 39 +++++++++++----------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c75924600..db32fd71bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,6 @@ env: .prettierrc tools PublishTempFolder: publish_artifacts - MODEL_VERSION_MODE: ${{ startsWith(github.ref, 'refs/tags/s') && 'tagTime' || 'file' }} INIT_SCRIPTS_BRANCH: 'unified-init-scripts' # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/common/scripts/show_version.js b/common/scripts/show_version.js index 0ac52f770d..7a49a74d5f 100644 --- a/common/scripts/show_version.js +++ b/common/scripts/show_version.js @@ -17,38 +17,23 @@ const fs = require('fs') const path = require('path') const exec = require('child_process').exec -function main (mode) { +function main() { exec('git describe --tags --abbrev=0', (err, stdout) => { if (err !== null) { - console.log('"0.7.0"') + console.log('"0.6.0"') return } - - const tag = stdout.trim() - - if (mode === 'tagTime') { - // Take tagged git commit date as model version - exec(`git for-each-ref --shell --format="%(creatordate:format:%s)" "refs/tags/${tag}"`, (err, stdout) => { - console.log(`"0.7.${err === null ? stdout.trim().slice(1, -1) : 0}"`) - }) - } else { - // Take version from file - let version - try { - const versionFilePath = path.resolve(__dirname, 'version.txt') - version = fs.readFileSync(versionFilePath, 'utf8').trim() - } catch (error) { - version = '"0.6.0"' - } - - console.log(version) + // Take version from file + let version + try { + const versionFilePath = path.resolve(__dirname, 'version.txt') + version = fs.readFileSync(versionFilePath, 'utf8').trim() + } catch (error) { + version = '"0.6.0"' } + + console.log(version) }) } -let mode = process.env.MODEL_VERSION_MODE -if (mode !== 'tagTime') { - mode = 'file' -} - -main(mode) +main()