add note for latest release readme

This commit is contained in:
Aakansha Doshi 2022-07-04 20:33:04 +05:30
parent 00ee7088b7
commit 77e8585d03
3 changed files with 26 additions and 5 deletions

View file

@ -1,11 +1,11 @@
name: Auto release @excalidraw/excalidraw-next name: Auto release @excalidraw/excalidraw@next
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
Auto-release-excalidraw-next: Auto-release-excalidraw@next:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -5,6 +5,20 @@ const updateChangelog = require("./updateChangelog");
const excalidrawDir = `${__dirname}/../src/packages/excalidraw`; const excalidrawDir = `${__dirname}/../src/packages/excalidraw`;
const excalidrawPackage = `${excalidrawDir}/package.json`; 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 updatePackageVersion = (nextVersion) => {
const pkg = require(excalidrawPackage); const pkg = require(excalidrawPackage);
@ -15,14 +29,17 @@ const updatePackageVersion = (nextVersion) => {
const release = async (nextVersion) => { const release = async (nextVersion) => {
try { try {
updateReadme();
await updateChangelog(nextVersion); await updateChangelog(nextVersion);
updatePackageVersion(nextVersion); updatePackageVersion(nextVersion);
await exec(`git add -u`); await exec(`git add -u`);
await exec( await exec(
`git commit -m "docs: release @excalidraw/excalidraw@${nextVersion} 🎉"`, `git commit -m "docs: release @excalidraw/excalidraw@${nextVersion} 🎉"`,
); );
/* eslint-disable no-console */ // revert readme after release
console.log("Done!"); fs.writeFileSync(`${excalidrawDir}/README.md`, originalReadMe, "utf8");
// /* eslint-disable no-console */
// console.log("Done!");
} catch (error) { } catch (error) {
console.error(error); console.error(error);
process.exit(1); process.exit(1);

View file

@ -2,6 +2,10 @@
Excalidraw exported as a component to directly embed in your projects. 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 ### Installation
You can use npm 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 #### 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 ### Demo