Add release command (#2022)

add release command
remove unescessary yarn.lock
This commit is contained in:
brendanlaschke 2023-10-14 23:04:35 +02:00 committed by GitHub
parent 160b7039d9
commit 3c9cd9ff4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 4 deletions

View File

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

23
infra/release/release.js Normal file
View File

@ -0,0 +1,23 @@
const fs = require("fs");
const semver = require("semver");
const path = require("path");
// Get the version argument from the command line
const [, , version] = process.argv;
if (!semver.valid(version)) {
console.error(
"Invalid version. The format should be X.X.X where X is a positive integer (or 0)."
);
process.exit(1);
}
const FrontPackageJson = path.join(__dirname, "../../front/package.json");
const ServerPackageJson = path.join(__dirname, "../../server/package.json");
// Update package.json
for (let file of [FrontPackageJson, ServerPackageJson]) {
let pkgdata = JSON.parse(fs.readFileSync(file));
pkgdata.version = version;
fs.writeFileSync(file, JSON.stringify(pkgdata, null, 2), "utf8");
}

9
package.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "twenty",
"scripts": {
"release": "node infra/release/release.js"
},
"dependencies": {
"semver": "^7.5.4"
}
}

View File

@ -2,3 +2,21 @@
# yarn lockfile v1
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
semver@^7.5.4:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==