-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpackage.ts
38 lines (30 loc) · 1.32 KB
/
package.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { compress } from "https://raw.githubusercontent.com/BugSplat-Git/deno-zip/d6591c94506fde867edb06578549ded598f345dc/mod.ts";
const supportedVersions = ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5'];
const pluginJson = JSON.parse(await Deno.readTextFile('./BugSplat.uplugin'));
// Remove downloaded symbol-upload-* files before packaging
const symUploaderDir = './Source/ThirdParty/SymUploader';
for await (const entry of Deno.readDir(symUploaderDir)) {
if (entry.isFile && entry.name.startsWith('symbol-upload-')) {
await Deno.remove(`${symUploaderDir}/${entry.name}`);
console.log(`Deleted ${entry.name}`);
}
}
// Update the plugin version for each supported Unreal Engine version
for (const unrealVersion of supportedVersions) {
const pluginVersion = pluginJson.VersionName;
pluginJson.EngineVersion = `${unrealVersion}.0`;
await Deno.writeTextFile('./BugSplat.uplugin', JSON.stringify(pluginJson, null, 4));
const zipName = `bugsplat-unreal-${pluginVersion}-unreal-${unrealVersion}.zip`;
const zipEntries = [
'Source',
'Resources',
'README.md',
'LICENSE.md',
'Content',
'Config',
'BugSplat.uplugin',
];
console.log(`About to create release package for Unreal Engine ${unrealVersion}...`);
await compress(zipEntries, zipName);
console.log(`Created ${zipName} successfully!`);
}