mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
add note for latest release readme
This commit is contained in:
parent
00ee7088b7
commit
77e8585d03
3 changed files with 26 additions and 5 deletions
4
.github/workflows/autorelease-excalidraw.yml
vendored
4
.github/workflows/autorelease-excalidraw.yml
vendored
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue