Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed May 22, 2024
1 parent 3d9bceb commit a76c4ee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
12 changes: 6 additions & 6 deletions docs/pixi-version.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"versionLabel": "v8.x",
"version": "8.1.0",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.1.0",
"build": "https://pixijs.download/v8.1.0/pixi.min.js",
"docs": "https://pixijs.download/v8.1.0/docs/index.html",
"npm": "8.1.0",
"version": "8.1.5",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.1.5",
"build": "https://pixijs.download/v8.1.5/pixi.min.js",
"docs": "https://pixijs.download/v8.1.5/docs/index.html",
"npm": "8.1.5",
"prerelease": false,
"latest": true
}
}
12 changes: 6 additions & 6 deletions pixi-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
},
{
"versionLabel": "v8.x",
"version": "8.1.0",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.1.0",
"build": "https://pixijs.download/v8.1.0/pixi.min.js",
"docs": "https://pixijs.download/v8.1.0/docs/index.html",
"npm": "8.1.0",
"version": "8.1.5",
"releaseNotes": "https://github.com/pixijs/pixijs/releases/tag/v8.1.5",
"build": "https://pixijs.download/v8.1.5/pixi.min.js",
"docs": "https://pixijs.download/v8.1.5/docs/index.html",
"npm": "8.1.5",
"prerelease": false,
"latest": true,
"isCurrent": true
}
]
]
15 changes: 12 additions & 3 deletions scripts/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ const inquirer = require('inquirer');
const fs = require('fs');
const path = require('path');

function updateVersionDetails(versionDetails, newVersion)
{
versionDetails.version = newVersion;
versionDetails.releaseNotes = `https://github.com/pixijs/pixijs/releases/tag/v${newVersion}`;
versionDetails.build = `https://pixijs.download/v${newVersion}/pixi.min.js`;
versionDetails.docs = `https://pixijs.download/v${newVersion}/docs/index.html`;
versionDetails.npm = newVersion;
}

// async iife
(async () =>
{
Expand Down Expand Up @@ -32,16 +41,16 @@ const path = require('path');
return;
}

version.version = answers.newVersion;
updateVersionDetails(version, answers.newVersion);

if (version.versionLabel === v8Version.versionLabel)
{
v8Version.version = answers.newVersion;
updateVersionDetails(v8Version, answers.newVersion);
fs.writeFileSync(path.join(process.cwd(), './docs/pixi-version.json'), JSON.stringify(v8Version, null, 2));
}
else if (version.versionLabel === v7Version.versionLabel)
{
v7Version.version = answers.newVersion;
updateVersionDetails(v7Version, answers.newVersion);
fs.writeFileSync(
path.join(process.cwd(), './versioned_docs/version-7.x/pixi-version.json'),
JSON.stringify(v7Version, null, 2),
Expand Down

0 comments on commit a76c4ee

Please sign in to comment.