From 5d068361ccff09d848c5c9aadaad1e8831f1cf05 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 22 Sep 2024 12:58:49 -0400 Subject: [PATCH 1/4] fix: Protect against dangerous characters in env --- server/routes/app.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/routes/app.ts b/server/routes/app.ts index f08decffd01c..d4286c76db8f 100644 --- a/server/routes/app.ts +++ b/server/routes/app.ts @@ -84,7 +84,10 @@ export const renderApp = async ( const page = await readIndexFile(); const environment = ` `; From 4fc1ed0d7ebdb1bd11078ded35d3a4c5ae5460a0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 22 Sep 2024 12:59:10 -0400 Subject: [PATCH 2/4] Add release script (#7637) --- package.json | 1 + server/scripts/release.js | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 server/scripts/release.js diff --git a/package.json b/package.json index 5e9ff27e2bf4..41959c9d4c24 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "prepare": "husky install", "postinstall": "yarn patch-package", "install-local-ssl": "node ./server/scripts/install-local-ssl.js", + "release": "node ./server/scripts/release.js", "heroku-postbuild": "yarn build && yarn db:migrate", "db:create-migration": "sequelize migration:create", "db:create": "sequelize db:create", diff --git a/server/scripts/release.js b/server/scripts/release.js new file mode 100644 index 000000000000..ecfb83b8a0b9 --- /dev/null +++ b/server/scripts/release.js @@ -0,0 +1,50 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ + +const { execSync } = require("child_process"); +const fs = require("fs"); +const path = require("path"); +const { exit } = require("process"); +const { addYears } = require("date-fns/addYears"); + +const input = process.argv.slice(2); + +if (input.length === 0) { + console.log("Usage: yarn release (major|minor|patch|1.2.3)"); + exit(1); +} + +const root = path.resolve(__dirname, "..", ".."); +const opts = { + cwd: root, +}; + +execSync(`npm version ${input.join(" ")} --no-git-tag-version`, opts); + +const package = require(path.resolve(root, "package.json")); + +const newVersion = package.version; +const license = fs.readFileSync(path.resolve(root, "LICENSE"), "utf8", opts); +const newDate = addYears(new Date(), 4).toISOString().split("T")[0]; + +// Update license +const newLicense = license + // Update version number + .replace( + /Licensed Work: {8}Outline (.*)/, + `Licensed Work: Outline ${newVersion}` + ) + // Update change date + .replace(/Change Date: {9}(.*)/, `Change Date: ${newDate}`) + // Update current year + .replace(/\(c\) \d{4}/, `(c) ${new Date().getFullYear()}`); + +fs.writeFileSync(path.resolve(root, "LICENSE"), newLicense); + +execSync(`git add package.json`, opts); +execSync(`git add LICENSE`, opts); +execSync(`git commit -m "v${newVersion}"`, opts); +execSync(`git tag v${newVersion}`, opts); +execSync(`git push origin v${newVersion}`, opts); +execSync(`git push origin main`, opts); + +console.log(`Released v${newVersion} 🚀`); From 62860c593b18cef9e1866ae92d5f8bc426824be5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 22 Sep 2024 13:00:48 -0400 Subject: [PATCH 3/4] fix: Version number not updated from previous release, #7635 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 41959c9d4c24..f0d81a53a973 100644 --- a/package.json +++ b/package.json @@ -367,5 +367,5 @@ "qs": "6.9.7", "rollup": "^4.5.1" }, - "version": "0.79.1" + "version": "0.80.0" } From 7adda26c6d920a05036d9284e9383e8e91ca4239 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 22 Sep 2024 13:00:56 -0400 Subject: [PATCH 4/4] v0.80.1 --- LICENSE | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 4a3d418522cb..6d3c7e8f8f58 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ Business Source License 1.1 Parameters Licensor: General Outline, Inc. -Licensed Work: Outline 0.79.1 +Licensed Work: Outline 0.80.1 The Licensed Work is (c) 2024 General Outline, Inc. Additional Use Grant: You may make use of the Licensed Work, provided that you may not use the Licensed Work for a Document @@ -15,7 +15,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that Licensed Work by creating teams and documents controlled by such third parties. -Change Date: 2028-09-05 +Change Date: 2028-09-22 Change License: Apache License, Version 2.0 diff --git a/package.json b/package.json index f0d81a53a973..8262ab7d1181 100644 --- a/package.json +++ b/package.json @@ -367,5 +367,5 @@ "qs": "6.9.7", "rollup": "^4.5.1" }, - "version": "0.80.0" + "version": "0.80.1" }