ci(create-release): use github app token

This commit is contained in:
ANTOND.
2025-05-04 01:50:09 +02:00
parent ce8a1ba50b
commit a9728663ca
3 changed files with 43 additions and 45 deletions

View File

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

View File

@@ -1,10 +1,6 @@
const fs = require('fs');
const packageJson = await Bun.file('./package/package.json').json();
const version = process.env.TGT_RELEASE_VERSION;
const newVersion = version.replace('v', '');
const newVersion = process.env.TGT_RELEASE_VERSION;
packageJson.version = newVersion.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);
await Bun.write('./package/package.json', JSON.stringify(packageJson, null, 2));