Compare commits

..

3 Commits

Author SHA1 Message Date
Frostebite
a38ec6caef Merge branch 'main' into linux-extension-rebased 2026-05-06 22:33:44 +01:00
Christian Tellefsen
2240bedf08 fix: update action runtime from Node.js 20 to Node.js 24 (#827)
GitHub is deprecating Node.js 20 on Actions runners:
- June 2, 2026: Node.js 24 forced as default
- September 16, 2026: Node.js 20 removed

Ref: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
Closes #826

Co-authored-by: Frostebite <jas.f.ukcmti@gmail.com>
2026-05-06 22:25:02 +01:00
frostebite
37ce35f1a5 feat: add linux64RemoveExecutableExtension parameter (default: false)
Adds configurable control over the `.x86_64` file extension for
StandaloneLinux64 builds. Default is `false` (keep the extension),
matching Unity's native behavior.

Set `linux64RemoveExecutableExtension: true` to restore the
extensionless behavior from v4.

Rebased from kitlith's original PR #726. Default flipped for v5.

Closes #722

Co-Authored-By: kitlith <kitlith@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-06 22:05:23 +01:00
7 changed files with 75 additions and 33 deletions

View File

@@ -178,6 +178,11 @@ inputs:
default: 'false' default: 'false'
required: false required: false
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.' description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
linux64RemoveExecutableExtension:
default: 'false'
required: false
description:
'When building for StandaloneLinux64, remove the default file extension of `.x86_64`. Set to true to restore the extensionless behavior from v4.'
outputs: outputs:
volume: volume:
@@ -195,5 +200,5 @@ branding:
icon: 'box' icon: 'box'
color: 'gray-dark' color: 'gray-dark'
runs: runs:
using: 'node20' using: 'node24'
main: 'dist/index.js' main: 'dist/index.js'

View File

@@ -32,19 +32,19 @@
"node": ">=18.x" "node": ">=18.x"
}, },
"dependencies": { "dependencies": {
"@actions/cache": "^4.1.0", "@actions/cache": "^4.0.0",
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^6.0.1", "@actions/github": "^6.0.0",
"commander": "^9.5.0", "commander": "^9.0.0",
"commander-ts": "^0.2.0", "commander-ts": "^0.2.0",
"md5": "^2.3.0", "md5": "^2.3.0",
"nanoid": "^3.3.12", "nanoid": "^3.3.1",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.1.13",
"semver": "^7.7.4", "semver": "^7.5.2",
"ts-md5": "^1.3.1", "ts-md5": "^1.3.1",
"unity-changeset": "^3.1.0", "unity-changeset": "^3.1.0",
"yaml": "^2.8.4" "yaml": "^2.2.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^17.0.23", "@types/node": "^17.0.23",

View File

@@ -117,18 +117,21 @@ describe('BuildParameters', () => {
}); });
test.each` test.each`
targetPlatform | expectedExtension | androidExportType targetPlatform | expectedExtension | androidExportType | linux64RemoveExecutableExtension
${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} ${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} | ${false}
${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} ${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} | ${true}
${Platform.types.Android} | ${''} | ${'androidStudioProject'} ${Platform.types.Android} | ${''} | ${'androidStudioProject'} | ${false}
${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} ${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} | ${true}
${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} ${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} | ${false}
${Platform.types.StandaloneLinux64} | ${'.x86_64'} | ${'n/a'} | ${false}
${Platform.types.StandaloneLinux64} | ${''} | ${'n/a'} | ${true}
`( `(
'appends $expectedExtension for $targetPlatform with androidExportType $androidExportType', 'appends $expectedExtension for $targetPlatform with linux64RemoveExecutableExtension=$linux64RemoveExecutableExtension',
async ({ targetPlatform, expectedExtension, androidExportType }) => { async ({ targetPlatform, expectedExtension, androidExportType, linux64RemoveExecutableExtension }) => {
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform); vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform); vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
vi.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType); vi.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType);
vi.spyOn(Input, 'linux64RemoveExecutableExtension', 'get').mockReturnValue(linux64RemoveExecutableExtension);
await expect(BuildParameters.create()).resolves.toEqual( await expect(BuildParameters.create()).resolves.toEqual(
expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }), expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }),
); );

View File

@@ -73,6 +73,7 @@ class BuildParameters {
Input.buildName, Input.buildName,
Input.targetPlatform, Input.targetPlatform,
Input.androidExportType, Input.androidExportType,
Input.linux64RemoveExecutableExtension,
); );
const editorVersion = UnityVersioning.determineUnityVersion( const editorVersion = UnityVersioning.determineUnityVersion(
Input.projectPath, Input.projectPath,
@@ -188,7 +189,12 @@ class BuildParameters {
}; };
} }
static parseBuildFile(filename: string, platform: string, androidExportType: string): string { static parseBuildFile(
filename: string,
platform: string,
androidExportType: string,
linux64RemoveExecutableExtension: boolean,
): string {
if (Platform.isWindows(platform)) { if (Platform.isWindows(platform)) {
return `${filename}.exe`; return `${filename}.exe`;
} }
@@ -208,6 +214,10 @@ class BuildParameters {
} }
} }
if (platform === Platform.types.StandaloneLinux64 && !linux64RemoveExecutableExtension) {
return `${filename}.x86_64`;
}
return filename; return filename;
} }

View File

@@ -353,4 +353,22 @@ describe('Input', () => {
expect(spy).toHaveBeenCalledTimes(1); expect(spy).toHaveBeenCalledTimes(1);
}); });
}); });
describe('linux64RemoveExecutableExtension', () => {
it('returns the default value', () => {
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
});
it('returns true when string true is passed', () => {
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(true);
expect(spy).toHaveBeenCalledTimes(1);
});
it('returns false when string false is passed', () => {
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
expect(spy).toHaveBeenCalledTimes(1);
});
});
}); });

View File

@@ -284,6 +284,12 @@ class Input {
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false'; return Input.getInput('skipActivation')?.toLowerCase() ?? 'false';
} }
static get linux64RemoveExecutableExtension(): boolean {
const input = Input.getInput('linux64RemoveExecutableExtension') ?? 'false';
return input === 'true';
}
public static ToEnvVarFormat(input: string) { public static ToEnvVarFormat(input: string) {
if (input.toUpperCase() === input) { if (input.toUpperCase() === input) {
return input; return input;

View File

@@ -5,7 +5,7 @@ __metadata:
version: 9 version: 9
cacheKey: 10 cacheKey: 10
"@actions/cache@npm:^4.1.0": "@actions/cache@npm:^4.0.0":
version: 4.1.0 version: 4.1.0
resolution: "@actions/cache@npm:4.1.0" resolution: "@actions/cache@npm:4.1.0"
dependencies: dependencies:
@@ -42,7 +42,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@actions/github@npm:^6.0.1": "@actions/github@npm:^6.0.0":
version: 6.0.1 version: 6.0.1
resolution: "@actions/github@npm:6.0.1" resolution: "@actions/github@npm:6.0.1"
dependencies: dependencies:
@@ -2341,7 +2341,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"commander@npm:^9.5.0": "commander@npm:^9.0.0":
version: 9.5.0 version: 9.5.0
resolution: "commander@npm:9.5.0" resolution: "commander@npm:9.5.0"
checksum: 10/41c49b3d0f94a1fbeb0463c85b13f15aa15a9e0b4d5e10a49c0a1d58d4489b549d62262b052ae0aa6cfda53299bee487bfe337825df15e342114dde543f82906 checksum: 10/41c49b3d0f94a1fbeb0463c85b13f15aa15a9e0b4d5e10a49c0a1d58d4489b549d62262b052ae0aa6cfda53299bee487bfe337825df15e342114dde543f82906
@@ -3800,7 +3800,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"nanoid@npm:^3.3.11, nanoid@npm:^3.3.12": "nanoid@npm:^3.3.1, nanoid@npm:^3.3.11":
version: 3.3.12 version: 3.3.12
resolution: "nanoid@npm:3.3.12" resolution: "nanoid@npm:3.3.12"
bin: bin:
@@ -4214,10 +4214,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"reflect-metadata@npm:^0.2.2": "reflect-metadata@npm:^0.1.13":
version: 0.2.2 version: 0.1.14
resolution: "reflect-metadata@npm:0.2.2" resolution: "reflect-metadata@npm:0.1.14"
checksum: 10/1c93f9ac790fea1c852fde80c91b2760420069f4862f28e6fae0c00c6937a56508716b0ed2419ab02869dd488d123c4ab92d062ae84e8739ea7417fae10c4745 checksum: 10/fcab9c17ec3b9fea0e2f748c2129aceb57c24af6d8d13842b8a77c8c79dde727d7456ce293e76e8d7b267d1dbf93eea4c5b3c9101299a789a075824f2e40f1ee
languageName: node languageName: node
linkType: hard linkType: hard
@@ -4807,16 +4807,16 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "unity-builder@workspace:." resolution: "unity-builder@workspace:."
dependencies: dependencies:
"@actions/cache": "npm:^4.1.0" "@actions/cache": "npm:^4.0.0"
"@actions/core": "npm:^1.11.1" "@actions/core": "npm:^1.11.1"
"@actions/exec": "npm:^1.1.1" "@actions/exec": "npm:^1.1.1"
"@actions/github": "npm:^6.0.1" "@actions/github": "npm:^6.0.0"
"@types/node": "npm:^17.0.23" "@types/node": "npm:^17.0.23"
"@types/semver": "npm:^7.3.9" "@types/semver": "npm:^7.3.9"
"@typescript/native-preview": "npm:^7.0.0-dev.20260505.1" "@typescript/native-preview": "npm:^7.0.0-dev.20260505.1"
"@vercel/ncc": "npm:^0.36.1" "@vercel/ncc": "npm:^0.36.1"
"@vitest/coverage-istanbul": "npm:^4.1.5" "@vitest/coverage-istanbul": "npm:^4.1.5"
commander: "npm:^9.5.0" commander: "npm:^9.0.0"
commander-ts: "npm:^0.2.0" commander-ts: "npm:^0.2.0"
cross-env: "npm:^7.0.3" cross-env: "npm:^7.0.3"
eslint: "npm:^10.3.0" eslint: "npm:^10.3.0"
@@ -4825,19 +4825,19 @@ __metadata:
js-yaml: "npm:^4.1.0" js-yaml: "npm:^4.1.0"
lint-staged: "npm:^16.4.0" lint-staged: "npm:^16.4.0"
md5: "npm:^2.3.0" md5: "npm:^2.3.0"
nanoid: "npm:^3.3.12" nanoid: "npm:^3.3.1"
node-fetch: "npm:2" node-fetch: "npm:2"
oxfmt: "npm:^0.48.0" oxfmt: "npm:^0.48.0"
oxlint: "npm:^1.63.0" oxlint: "npm:^1.63.0"
reflect-metadata: "npm:^0.2.2" reflect-metadata: "npm:^0.1.13"
semver: "npm:^7.7.4" semver: "npm:^7.5.2"
ts-md5: "npm:^1.3.1" ts-md5: "npm:^1.3.1"
ts-node: "npm:10.8.1" ts-node: "npm:10.8.1"
typescript: "npm:4.7.4" typescript: "npm:4.7.4"
unity-changeset: "npm:^3.1.0" unity-changeset: "npm:^3.1.0"
vite: "npm:^7" vite: "npm:^7"
vitest: "npm:^4" vitest: "npm:^4"
yaml: "npm:^2.8.4" yaml: "npm:^2.2.2"
yarn-audit-fix: "npm:^9.3.8" yarn-audit-fix: "npm:^9.3.8"
dependenciesMeta: dependenciesMeta:
lefthook: lefthook:
@@ -5209,7 +5209,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"yaml@npm:^2.8.2, yaml@npm:^2.8.4": "yaml@npm:^2.2.2, yaml@npm:^2.8.2":
version: 2.8.4 version: 2.8.4
resolution: "yaml@npm:2.8.4" resolution: "yaml@npm:2.8.4"
bin: bin: