diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b18e2f7b3c..573d498ed1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/packages/platform-rig/bin/bump-package-version.js b/packages/platform-rig/bin/bump-package-version.js new file mode 100755 index 0000000000..3eab02b6f8 --- /dev/null +++ b/packages/platform-rig/bin/bump-package-version.js @@ -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}`) + } +})