diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1032b09..0548395 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -246,25 +246,25 @@ jobs: image: refringe/spt-build-server:0.0.4 steps: - name: Create Directory - run: mkdir -p /workspace/refringe/Build/assembled + run: mkdir -p /workspace/refringe/Build/release - name: Download Server Build Artifact uses: actions/download-artifact@v3 with: name: server-build - path: /workspace/refringe/Build/assembled/ + path: /workspace/refringe/Build/release/ - name: Download Modules Build Artifact uses: actions/download-artifact@v3 with: name: modules-build - path: /workspace/refringe/Build/assembled/ + path: /workspace/refringe/Build/release/ - name: Download Launcher Build Artifact uses: actions/download-artifact@v3 with: name: launcher-build - path: /workspace/refringe/Build/assembled/ + path: /workspace/refringe/Build/release/ - name: Clone Build Project uses: actions/checkout@v3 @@ -272,9 +272,19 @@ jobs: path: /workspace/refringe/Build/build - name: Merge Static and Dynamic Files - run: cp -rvf /workspace/refringe/Build/build/project/static/* /workspace/refringe/Build/assembled/ + run: cp -rvf /workspace/refringe/Build/build/project/static/* /workspace/refringe/Build/release/ shell: bash - - name: List Directory Contents - run: tree /workspace/refringe/Build/assembled + - name: List Release Contents + run: tree /workspace/refringe/Build/release shell: bash + + - name: Compress Release + run: | + cd /workspace/refringe/Build/release + 7z a -mx=9 -m0=lzma2 ../release.7z ./* + echo "Release compressed." + + - name: List Release File + run: | + ls -la /workspace/refringe/Build/release.7z diff --git a/project/build.ps1 b/project/build.ps1 deleted file mode 100644 index a28584a..0000000 Binary files a/project/build.ps1 and /dev/null differ diff --git a/project/build_launcher.ps1 b/project/build_launcher.ps1 deleted file mode 100644 index 213c962..0000000 Binary files a/project/build_launcher.ps1 and /dev/null differ diff --git a/project/build_modules.ps1 b/project/build_modules.ps1 deleted file mode 100644 index 3815db5..0000000 Binary files a/project/build_modules.ps1 and /dev/null differ diff --git a/project/build_server.ps1 b/project/build_server.ps1 deleted file mode 100644 index 0327fe3..0000000 Binary files a/project/build_server.ps1 and /dev/null differ diff --git a/project/combine.ps1 b/project/combine.ps1 deleted file mode 100644 index a9b1b93..0000000 Binary files a/project/combine.ps1 and /dev/null differ diff --git a/project/header.ps1 b/project/header.ps1 deleted file mode 100644 index 53af4fc..0000000 --- a/project/header.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -Write-Output "" -Write-Output " █████╗ ██████╗ ████████╗" -Write-Output " ██╔════╝ ██╔══██╗╚══██╔══╝" -Write-Output " ╚█████╗ ██████╔╝ ██║" -Write-Output " ╚═══██╗ ██╔═══╝ ██║" -Write-Output " ██████╔╝ ██║ ██║" -Write-Output " ╚═════╝ ╚═╝ ╚═╝" -Write-Output " Once it hits your lips," -Write-Output " it's so good!" -Write-Output "" diff --git a/project/modify-launcher-executable.js b/project/modify-launcher-executable.js new file mode 100644 index 0000000..86dc633 --- /dev/null +++ b/project/modify-launcher-executable.js @@ -0,0 +1,53 @@ +/** + * The sole purpose of this script is to modify the version information and icon of the Launcher project's built + * executable. This is not a necessary step for the build process, but it is a nice-to-have for the final product. + * It is required during the CI build process because .NET 6 will not compile this information into the executable + * on a Linux environment. If the Launcher project is ever updated to .NET v8 this script will no longer be necessary. + */ +const fs = require('fs').promises; +const path = require('path'); +const ResEdit = require('resedit-js'); + +const manifest = { + icon: '/workspace/refringe/Build/build/project/icon.launcher.ico', + author: 'SPT-AKI Launcher', + description: 'The single-player modding framework for Escape From Tarkov.', + name: 'aki-launcher', + license: 'NCSA', + version: '1.0.0', // TODO: +}; + +const serverExe = '/workspace/refringe/Build/assembled/Aki.Launcher.exe'; + +const updateBuildProperties = async () => { + const exe = ResEdit.NtExecutable.from(await fs.readFile(serverExe)); + const res = ResEdit.NtExecutableResource.from(exe); + + const iconPath = path.resolve(manifest.icon); + const iconFile = ResEdit.Data.IconFile.from(await fs.readFile(iconPath)); + + ResEdit.Resource.IconGroupEntry.replaceIconsForResource( + res.entries, + 1, + 1033, + iconFile.icons.map((item) => item.data), + ); + + const vi = ResEdit.Resource.VersionInfo.fromEntries(res.entries)[0]; + + vi.setStringValues({ lang: 1033, codepage: 1200 }, { + ProductName: manifest.author, + FileDescription: manifest.description, + CompanyName: manifest.name, + LegalCopyright: manifest.license, + }); + vi.removeStringValue({ lang: 1033, codepage: 1200 }, "OriginalFilename"); + vi.removeStringValue({ lang: 1033, codepage: 1200 }, "InternalName"); + vi.setFileVersion(...manifest.version.split(".").map(Number)); + vi.setProductVersion(...manifest.version.split(".").map(Number)); + vi.outputToResourceEntries(res.entries); + res.outputResource(exe, true); + await fs.writeFile(serverExe, Buffer.from(exe.generate())); +}; + +updateBuildProperties().catch(console.error); diff --git a/project/tag_validate.ps1 b/project/tag_validate.ps1 deleted file mode 100644 index e9ae7f5..0000000 Binary files a/project/tag_validate.ps1 and /dev/null differ