mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-01 06:16:14 -07:00
Compare commits
8 Commits
linux-exte
...
feature/us
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4233b08bae | ||
|
|
2badde1790 | ||
|
|
eba50f7627 | ||
|
|
f8b20890d9 | ||
|
|
b57598a959 | ||
|
|
7b2ec07fc1 | ||
|
|
3d3a018c23 | ||
|
|
a12e3e829e |
6
.github/workflows/build-tests-mac.yml
vendored
6
.github/workflows/build-tests-mac.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
|||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.45f1
|
- 2021.3.45f2
|
||||||
- 2022.3.13f1
|
- 2022.3.62f3
|
||||||
- 2023.2.2f1
|
- 2023.2.22f1
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
- StandaloneOSX # Build a MacOS executable
|
- StandaloneOSX # Build a MacOS executable
|
||||||
- iOS # Build an iOS executable
|
- iOS # Build an iOS executable
|
||||||
|
|||||||
6
.github/workflows/build-tests-ubuntu.yml
vendored
6
.github/workflows/build-tests-ubuntu.yml
vendored
@@ -48,9 +48,9 @@ jobs:
|
|||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.32f1
|
- 2021.3.45f2
|
||||||
- 2022.3.13f1
|
- 2022.3.62f3
|
||||||
- 2023.2.2f1
|
- 2023.2.22f1
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
|
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
|
||||||
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
|
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
|
||||||
|
|||||||
6
.github/workflows/build-tests-windows.yml
vendored
6
.github/workflows/build-tests-windows.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
|||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.32f1
|
- 2021.3.45f2
|
||||||
- 2022.3.13f1
|
- 2022.3.62f3
|
||||||
- 2023.2.2f1
|
- 2023.2.22f1
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
- Android # Build an Android apk.
|
- Android # Build an Android apk.
|
||||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: 'Custom parameters to configure the build.'
|
description: 'Custom parameters to configure the build.'
|
||||||
|
useHostNetwork:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: 'Initialises Docker using the host network. (Linux only)'
|
||||||
versioning:
|
versioning:
|
||||||
required: false
|
required: false
|
||||||
default: 'Semantic'
|
default: 'Semantic'
|
||||||
|
|||||||
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
@@ -327,6 +327,7 @@ class BuildParameters {
|
|||||||
androidExportType: input_1.default.androidExportType,
|
androidExportType: input_1.default.androidExportType,
|
||||||
androidSymbolType: androidSymbolExportType,
|
androidSymbolType: androidSymbolExportType,
|
||||||
customParameters: input_1.default.customParameters,
|
customParameters: input_1.default.customParameters,
|
||||||
|
useHostNetwork: input_1.default.useHostNetwork,
|
||||||
sshAgent: input_1.default.sshAgent,
|
sshAgent: input_1.default.sshAgent,
|
||||||
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
||||||
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
||||||
@@ -637,7 +638,7 @@ class Docker {
|
|||||||
return await (0, exec_1.exec)(runCommand, undefined, options);
|
return await (0, exec_1.exec)(runCommand, undefined, options);
|
||||||
}
|
}
|
||||||
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
||||||
const { workspace, actionFolder, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
const { workspace, actionFolder, useHostNetwork, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||||
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
||||||
if (!(0, node_fs_1.existsSync)(githubHome))
|
if (!(0, node_fs_1.existsSync)(githubHome))
|
||||||
(0, node_fs_1.mkdirSync)(githubHome);
|
(0, node_fs_1.mkdirSync)(githubHome);
|
||||||
@@ -670,6 +671,7 @@ class Docker {
|
|||||||
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
||||||
: ''} \
|
: ''} \
|
||||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||||
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||||
${image} \
|
${image} \
|
||||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||||
@@ -1382,6 +1384,10 @@ class Input {
|
|||||||
static get customParameters() {
|
static get customParameters() {
|
||||||
return Input.getInput('customParameters') ?? '';
|
return Input.getInput('customParameters') ?? '';
|
||||||
}
|
}
|
||||||
|
static get useHostNetwork() {
|
||||||
|
const input = Input.getInput('useHostNetwork') ?? false;
|
||||||
|
return input === 'true';
|
||||||
|
}
|
||||||
static get versioningStrategy() {
|
static get versioningStrategy() {
|
||||||
return Input.getInput('versioning') ?? 'Semantic';
|
return Input.getInput('versioning') ?? 'Semantic';
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -219,5 +219,10 @@ describe('BuildParameters', () => {
|
|||||||
jest.spyOn(Input, 'customParameters', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'customParameters', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ customParameters: mockValue }));
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ customParameters: mockValue }));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each([true, false])('returns the flag for useHostNetwork when %s', async (mockValue) => {
|
||||||
|
jest.spyOn(Input, 'useHostNetwork', 'get').mockReturnValue(mockValue);
|
||||||
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ useHostNetwork: mockValue }));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class BuildParameters {
|
|||||||
public containerRegistryImageVersion!: string;
|
public containerRegistryImageVersion!: string;
|
||||||
|
|
||||||
public customParameters!: string;
|
public customParameters!: string;
|
||||||
|
public useHostNetwork!: boolean;
|
||||||
public sshAgent!: string;
|
public sshAgent!: string;
|
||||||
public sshPublicKeysDirectoryPath!: string;
|
public sshPublicKeysDirectoryPath!: string;
|
||||||
public providerStrategy!: string;
|
public providerStrategy!: string;
|
||||||
@@ -141,6 +142,7 @@ class BuildParameters {
|
|||||||
androidExportType: Input.androidExportType,
|
androidExportType: Input.androidExportType,
|
||||||
androidSymbolType: androidSymbolExportType,
|
androidSymbolType: androidSymbolExportType,
|
||||||
customParameters: Input.customParameters,
|
customParameters: Input.customParameters,
|
||||||
|
useHostNetwork: Input.useHostNetwork,
|
||||||
sshAgent: Input.sshAgent,
|
sshAgent: Input.sshAgent,
|
||||||
sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath,
|
sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath,
|
||||||
gitPrivateToken: Input.gitPrivateToken ?? (await GithubCliReader.GetGitHubAuthToken()),
|
gitPrivateToken: Input.gitPrivateToken ?? (await GithubCliReader.GetGitHubAuthToken()),
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class Docker {
|
|||||||
const {
|
const {
|
||||||
workspace,
|
workspace,
|
||||||
actionFolder,
|
actionFolder,
|
||||||
|
useHostNetwork,
|
||||||
runnerTempPath,
|
runnerTempPath,
|
||||||
sshAgent,
|
sshAgent,
|
||||||
sshPublicKeysDirectoryPath,
|
sshPublicKeysDirectoryPath,
|
||||||
@@ -85,6 +86,7 @@ class Docker {
|
|||||||
: ''
|
: ''
|
||||||
} \
|
} \
|
||||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||||
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||||
${image} \
|
${image} \
|
||||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||||
|
|||||||
@@ -334,4 +334,22 @@ describe('Input', () => {
|
|||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('useHostNetwork', () => {
|
||||||
|
it('returns the default value', () => {
|
||||||
|
expect(Input.useHostNetwork).toStrictEqual(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns true when string true is passed', () => {
|
||||||
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
|
expect(Input.useHostNetwork).toStrictEqual(true);
|
||||||
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false when string false is passed', () => {
|
||||||
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
|
expect(Input.useHostNetwork).toStrictEqual(false);
|
||||||
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -139,6 +139,12 @@ class Input {
|
|||||||
return Input.getInput('customParameters') ?? '';
|
return Input.getInput('customParameters') ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get useHostNetwork(): boolean {
|
||||||
|
const input = Input.getInput('useHostNetwork') ?? false;
|
||||||
|
|
||||||
|
return input === 'true';
|
||||||
|
}
|
||||||
|
|
||||||
static get versioningStrategy(): string {
|
static get versioningStrategy(): string {
|
||||||
return Input.getInput('versioning') ?? 'Semantic';
|
return Input.getInput('versioning') ?? 'Semantic';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user