Skip to content

Commit

Permalink
Tweak release script to update both website's and src-docs's vers…
Browse files Browse the repository at this point in the history
…ions.json (elastic#7941)

Co-authored-by: Tomasz Kajtoch <tomek@kajto.ch>
  • Loading branch information
cee-chen and tkajtoch authored Aug 2, 2024
1 parent 78eb19d commit 943331d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion packages/eui/scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ const hasStep = (step) => {
await updateTokenChangelog(versionTarget);

// Update version switcher data and changelog
if (!isSpecialRelease) updateDocsVersionSwitcher(versionTarget);
if (!isSpecialRelease) {
updateDocsVersionSwitcher(versionTarget);

// TODO: Remove this once EUI is fully on the new website and src-docs has been removed
const oldEuiDocsVersions = cwd + '/src-docs/src/components/guide_page/versions.json';
updateDocsVersionSwitcher(versionTarget, oldEuiDocsVersions);
}
updateChangelog(changelog, versionTarget);
execSync('git commit -m "Updated changelog" -n');

Expand Down
6 changes: 3 additions & 3 deletions packages/eui/scripts/update-versions-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const fs = require('fs');
const { execSync } = require('child_process');

const rootDir = path.resolve(__dirname, '..');
const versionsLogFile =
rootDir + '/src-docs/src/components/guide_page/versions.json';
const websiteDir = path.resolve(__dirname, '../../website');
const versionsLogFile = path.join(websiteDir, '/static/versions.json');

/**
* Writes to the above `versions.json` file (which is what the docs version switcher
* uses to generate its list of versions) with the latest release
*
* To test locally, run `node -e "require('./scripts/update-versions-log')('vX.Y.Z')"`
* To test locally, run `node -e "require('./scripts/update-versions-log').updateDocsVersionSwitcher('vX.Y.Z')"`
*/
const updateDocsVersionSwitcher = (versionToAdd, file = versionsLogFile) => {
if (!versionToAdd) {
Expand Down
1 change: 1 addition & 0 deletions packages/website/static/versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"euiVersions": [
"95.5.0",
"95.4.0",
"95.3.0",
"95.2.0",
Expand Down

0 comments on commit 943331d

Please sign in to comment.