diff --git a/.github/workflows/autorelease-excalidraw.yml b/.github/workflows/autorelease-excalidraw.yml index ce7cc2fde2..d0fd6234ac 100644 --- a/.github/workflows/autorelease-excalidraw.yml +++ b/.github/workflows/autorelease-excalidraw.yml @@ -1,11 +1,11 @@ -name: Auto release @excalidraw/excalidraw-next +name: Auto release @excalidraw/excalidraw@next on: push: branches: - master jobs: - Auto-release-excalidraw-next: + Auto-release-excalidraw@next: runs-on: ubuntu-latest steps: diff --git a/scripts/release.js b/scripts/release.js index e552a5eedd..9f16931aa7 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -5,6 +5,20 @@ const updateChangelog = require("./updateChangelog"); const excalidrawDir = `${__dirname}/../src/packages/excalidraw`; const excalidrawPackage = `${excalidrawDir}/package.json`; +const originalReadMe = fs.readFileSync(`${excalidrawDir}/README.md`, "utf8"); + +const updateReadme = () => { + let data = originalReadMe; + + const noteIndex = data.indexOf("#### Note"); + const installlationIndex = data.indexOf("### Installation"); + + // remove note for stable readme + data = data.slice(0, noteIndex) + data.slice(installlationIndex); + + // update readme + fs.writeFileSync(`${excalidrawDir}/README.md`, data, "utf8"); +}; const updatePackageVersion = (nextVersion) => { const pkg = require(excalidrawPackage); @@ -15,14 +29,17 @@ const updatePackageVersion = (nextVersion) => { const release = async (nextVersion) => { try { + updateReadme(); await updateChangelog(nextVersion); updatePackageVersion(nextVersion); await exec(`git add -u`); await exec( `git commit -m "docs: release @excalidraw/excalidraw@${nextVersion} 🎉"`, ); - /* eslint-disable no-console */ - console.log("Done!"); + // revert readme after release + fs.writeFileSync(`${excalidrawDir}/README.md`, originalReadMe, "utf8"); + // /* eslint-disable no-console */ + // console.log("Done!"); } catch (error) { console.error(error); process.exit(1); diff --git a/src/packages/excalidraw/README.md b/src/packages/excalidraw/README.md index 5799591c13..7ce2730117 100644 --- a/src/packages/excalidraw/README.md +++ b/src/packages/excalidraw/README.md @@ -2,6 +2,10 @@ Excalidraw exported as a component to directly embed in your projects. +#### Note + +You are viewing the docs for the **next** release, in case you want to check the docs for the stable release, you can view it [here](https://www.npmjs.com/package/@excalidraw/excalidraw). + ### Installation You can use npm @@ -26,7 +30,7 @@ If you want to load assets from a different path you can set a variable `window. #### Note -**If you don't want to wait for the next stable release and try out the unreleased changes you can use [@excalidraw/excalidraw-next](https://www.npmjs.com/package/@excalidraw/excalidraw-next).** +**If you don't want to wait for the next stable release and try out the unreleased changes you can use `@excalidraw/excalidraw@next`.** ### Demo