Make a master tag of the extensions API (#2888)

* Make a master tag of the extensions API

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* use the gitref as a prerelease header

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Reduce the number of releases

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix if

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-06-07 10:40:39 +03:00
1 parent 0fb927f96b
commit 278510a90a
4 files changed
+57 -6

No files matched your search

+15 -3
View File
@@ -22,8 +22,20 @@ import * as fs from "fs";
import * as path from "path";
import packageInfo from "../src/extensions/npm/extensions/package.json";
import appInfo from "../package.json";
import { SemVer } from "semver";
import { execSync } from "child_process";
const packagePath = path.join(__dirname, "../src/extensions/npm/extensions/package.json");
const { NPM_RELEASE_TAG = "latest" } = process.env;
const version = new SemVer(appInfo.version);
packageInfo.version = appInfo.version;
fs.writeFileSync(packagePath, `${JSON.stringify(packageInfo, null, 2)}\n`);
if (NPM_RELEASE_TAG !== "latest") {
const gitRef = execSync("git rev-parse --short HEAD", {
encoding: "utf-8",
});
version.inc("prerelease", `git.${gitRef.trim()}`);
}
packageInfo.version = version.format();
fs.writeFileSync(path.join(__dirname, "../src/extensions/npm/extensions/package.json"), `${JSON.stringify(packageInfo, null, 2)}\n`);