mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
parent
b1cc8fdbbf
commit
1b743ee6be
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -52,7 +52,7 @@ jobs:
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
cache-name: cache-node-platform
|
||||
with:
|
||||
path: |
|
||||
common/temp
|
||||
|
27
packages/platform-rig/bin/bump-package-version.js
Executable file
27
packages/platform-rig/bin/bump-package-version.js
Executable file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright © 2022 Hardcore Engineering Inc.
|
||||
//
|
||||
|
||||
const child_process = require('child_process')
|
||||
|
||||
child_process.exec('git describe --tags --abbrev=0', (err, stdout, stderr) => {
|
||||
if (err !== null) {
|
||||
if (err.message.includes('No names found')) {
|
||||
console.log('No git version available')
|
||||
return
|
||||
}
|
||||
console.log('Error', err)
|
||||
process.exit(1)
|
||||
}
|
||||
const rawVersion = stdout.trim().replace('v', '').replace('u', '').split('.')
|
||||
if (rawVersion.length === 3) {
|
||||
const version = {
|
||||
major: parseInt(rawVersion[0]),
|
||||
minor: parseInt(rawVersion[1]),
|
||||
patch: parseInt(rawVersion[2])
|
||||
}
|
||||
const versionStr = `${version.major}.${version.minor}.${version.patch}`
|
||||
console.log(`Setting version to ${versionStr}`)
|
||||
child_process.exec(`npm version ${versionStr}`)
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue
Block a user