mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Exported Git commit hash from update script
ref https://linear.app/tryghost/issue/DEV-25/move-version-bumping-logic-into-ghost-repo - this allows us to re-use the value from outside the script in CI
This commit is contained in:
parent
2c1d57dcef
commit
0854f8a531
1 changed files with 3 additions and 1 deletions
4
.github/scripts/bump-version.js
vendored
4
.github/scripts/bump-version.js
vendored
|
@ -15,11 +15,12 @@ const semver = require('semver');
|
|||
const firstArg = process.argv[2];
|
||||
console.log('firstArg', firstArg);
|
||||
|
||||
const buildString = await exec('git rev-parse --short HEAD').then(({stdout}) => stdout.trim());
|
||||
|
||||
let newVersion;
|
||||
|
||||
if (firstArg === 'canary') {
|
||||
const bumpedVersion = semver.inc(current_version, 'minor');
|
||||
const buildString = await exec('git rev-parse --short HEAD').then(({stdout}) => stdout.trim());
|
||||
newVersion = `${bumpedVersion}-pre-g${buildString}`;
|
||||
} else {
|
||||
const gitVersion = await exec('git describe --long HEAD').then(({stdout}) => stdout.trim().replace(/^v/, ''));
|
||||
|
@ -40,4 +41,5 @@ const semver = require('semver');
|
|||
console.log('Version bumped to', newVersion);
|
||||
|
||||
core.setOutput('BUILD_VERSION', newVersion);
|
||||
core.setOutput('GIT_COMMIT_HASH', buildString)
|
||||
})();
|
||||
|
|
Loading…
Add table
Reference in a new issue