mirror of
https://github.com/hcengineering/platform.git
synced 2025-03-15 02:23:12 +00:00
Remove 0.7 tagTime versioning
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
56a656bc6a
commit
04048c18f0
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user