mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
version : tag, commit, and date from iProductConfiguration
This commit is contained in:
parent
e3c826b253
commit
7482e2aa82
2 changed files with 30 additions and 3 deletions
|
|
@ -76,9 +76,9 @@
|
|||
"extensions-ci-pr": "node ./node_modules/gulp/bin/gulp.js extensions-ci-pr",
|
||||
"perf": "node scripts/code-perf.js",
|
||||
"update-build-ts-version": "npm install typescript@next && tsc -p ./build/tsconfig.build.json",
|
||||
"void-version-patch": "node -e \"const p=require('./product.json');p.voidVersion=require('semver').inc(p.voidVersion,'patch');require('fs').writeFileSync('./product.json',JSON.stringify(p,null,2))\" && git add product.json && git commit -m \"Bump: voidVersion\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags",
|
||||
"void-version-minor": "node -e \"const p=require('./product.json');p.voidVersion=require('semver').inc(p.voidVersion,'minor');require('fs').writeFileSync('./product.json',JSON.stringify(p,null,2))\" && git add product.json && git commit -m \"Bump: voidVersion minor\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags",
|
||||
"void-version-major": "node -e \"const p=require('./product.json');p.voidVersion=require('semver').inc(p.voidVersion,'major');require('fs').writeFileSync('./product.json',JSON.stringify(p,null,2))\" && git add product.json && git commit -m \"Bump: voidVersion major\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags"
|
||||
"void-version-patch": "node scripts/update-version.js patch && git add product.json && git commit -m \"Bump: voidVersion\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags",
|
||||
"void-version-minor": "node scripts/update-version.js minor && git add product.json && git commit -m \"Bump: voidVersion minor\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags",
|
||||
"void-version-major": "node scripts/update-version.js major && git add product.json && git commit -m \"Bump: voidVersion major\" && git tag v$(node -e \"console.log(require('./product.json').voidVersion)\") && git push && git push --tags"
|
||||
},
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.32.1",
|
||||
|
|
|
|||
27
scripts/update-version.js
Normal file
27
scripts/update-version.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
const fs = require('fs');
|
||||
const { execSync } = require('child_process');
|
||||
const semver = require('semver');
|
||||
|
||||
function updateProductJson(type = 'patch') {
|
||||
// Read product.json
|
||||
const productJsonPath = './product.json';
|
||||
const product = require('../' + productJsonPath);
|
||||
|
||||
// Update the version
|
||||
product.voidVersion = semver.inc(product.voidVersion, type);
|
||||
|
||||
// Update the commit hash
|
||||
product.commit = execSync('git rev-parse HEAD').toString().trim();
|
||||
|
||||
// Update the date
|
||||
product.date = new Date().toISOString().split('T')[0];
|
||||
|
||||
// Write the modifications
|
||||
fs.writeFileSync(productJsonPath, JSON.stringify(product, null, 2));
|
||||
|
||||
return product.voidVersion;
|
||||
}
|
||||
|
||||
// Execute the update
|
||||
const newVersion = updateProductJson(process.argv[2] || 'patch');
|
||||
console.log(`Updated version: ${newVersion}`);
|
||||
Loading…
Reference in a new issue