ci(create-release): restructure and update versions

This commit is contained in:
ANTOND.
2025-05-02 16:21:55 +02:00
parent 9c9cb7e4e4
commit 17f38dfd31
3 changed files with 61 additions and 62 deletions

View File

@@ -1,10 +1,10 @@
const fs = require('fs')
const fs = require('fs');
const version = process.env.TGT_RELEASE_VERSION
const newVersion = version.replace('v', '')
const version = process.env.TGT_RELEASE_VERSION;
const newVersion = version.replace('v', '');
const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'})
const manifestFile = fs.readFileSync('fxmanifest.lua', { encoding: 'utf8' });
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`)
const newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, `version '${newVersion}'`);
fs.writeFileSync('fxmanifest.lua', newFileContent)
fs.writeFileSync('fxmanifest.lua', newFileContent);

10
.github/actions/bump-package-version.js vendored Normal file
View File

@@ -0,0 +1,10 @@
const fs = require('fs');
const version = process.env.TGT_RELEASE_VERSION;
const newVersion = version.replace('v', '');
const packageFile = fs.readFileSync('package/package.json', { encoding: 'utf8' });
const newFileContent = packageFile.replace(/"version":\s+"(.*)",$/gm, `"version": "${newVersion}",`);
fs.writeFileSync('package/package.json', newFileContent);