Merge branch 'fix/unity-alias' of https://github.com/BLaZeKiLL/unity-builder into BLaZeKiLL-fix/unity-alias

This commit is contained in:
Webber 2020-11-01 15:06:09 +01:00
commit 6c2fbff839
6 changed files with 48 additions and 51 deletions

File diff suppressed because one or more lines are too long

20
action/steps/activate.sh Normal file → Executable file
View File

@ -24,8 +24,7 @@ if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then
fi fi
# Activate license # Activate license
ACTIVATION_OUTPUT=$(xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \ ACTIVATION_OUTPUT=$(unity-editor \
/opt/Unity/Editor/Unity \
-batchmode \ -batchmode \
-nographics \ -nographics \
-logFile /dev/stdout \ -logFile /dev/stdout \
@ -63,15 +62,14 @@ elif [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then
echo "Requesting activation (professional license)" echo "Requesting activation (professional license)"
# Activate license # Activate license
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \ unity-editor \
/opt/Unity/Editor/Unity \ -batchmode \
-batchmode \ -nographics \
-nographics \ -logFile /dev/stdout \
-logFile /dev/stdout \ -quit \
-quit \ -serial "$UNITY_SERIAL" \
-serial "$UNITY_SERIAL" \ -username "$UNITY_EMAIL" \
-username "$UNITY_EMAIL" \ -password "$UNITY_PASSWORD"
-password "$UNITY_PASSWORD"
# Store the exit code from the verify command # Store the exit code from the verify command
UNITY_EXIT_CODE=$? UNITY_EXIT_CODE=$?

View File

@ -108,25 +108,24 @@ echo "# Building platform #"
echo "###########################" echo "###########################"
echo "" echo ""
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \ unity-editor \
/opt/Unity/Editor/Unity \ -batchmode \
-batchmode \ -nographics \
-nographics \ -logfile /dev/stdout \
-logfile /dev/stdout \ -quit \
-quit \ -customBuildName "$BUILD_NAME" \
-customBuildName "$BUILD_NAME" \ -projectPath "$UNITY_PROJECT_PATH" \
-projectPath "$UNITY_PROJECT_PATH" \ -buildTarget "$BUILD_TARGET" \
-buildTarget "$BUILD_TARGET" \ -customBuildTarget "$BUILD_TARGET" \
-customBuildTarget "$BUILD_TARGET" \ -customBuildPath "$CUSTOM_BUILD_PATH" \
-customBuildPath "$CUSTOM_BUILD_PATH" \ -executeMethod "$BUILD_METHOD" \
-executeMethod "$BUILD_METHOD" \ -buildVersion "$VERSION" \
-buildVersion "$VERSION" \ -androidVersionCode "$ANDROID_VERSION_CODE" \
-androidVersionCode "$ANDROID_VERSION_CODE" \ -androidKeystoreName "$ANDROID_KEYSTORE_NAME" \
-androidKeystoreName "$ANDROID_KEYSTORE_NAME" \ -androidKeystorePass "$ANDROID_KEYSTORE_PASS" \
-androidKeystorePass "$ANDROID_KEYSTORE_PASS" \ -androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \
-androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \ -androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \
-androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \ $CUSTOM_PARAMETERS
$CUSTOM_PARAMETERS
# Catch exit code # Catch exit code
BUILD_EXIT_CODE=$? BUILD_EXIT_CODE=$?

13
action/steps/return_license.sh Normal file → Executable file
View File

@ -6,11 +6,10 @@ if [[ -n "$UNITY_SERIAL" ]]; then
# #
# This will return the license that is currently in use. # This will return the license that is currently in use.
# #
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \ unity-editor \
/opt/Unity/Editor/Unity \ -batchmode \
-batchmode \ -nographics \
-nographics \ -logFile /dev/stdout \
-logFile /dev/stdout \ -quit \
-quit \ -returnlicense
-returnlicense
fi fi

View File

@ -4,8 +4,8 @@ import Platform from './platform';
class ImageTag { class ImageTag {
constructor(imageProperties) { constructor(imageProperties) {
const { const {
repository = 'gableroux', repository = 'unityci',
name = 'unity3d', name = 'editor',
version = '2019.2.11f1', version = '2019.2.11f1',
platform, platform,
customImage, customImage,
@ -36,8 +36,9 @@ class ImageTag {
return { return {
generic: '', generic: '',
webgl: 'webgl', webgl: 'webgl',
mac: 'mac', mac: 'mac-mono',
windows: 'windows', windows: 'windows-mono',
linux: 'base',
android: 'android', android: 'android',
ios: 'ios', ios: 'ios',
facebook: 'facebook', facebook: 'facebook',
@ -45,14 +46,14 @@ class ImageTag {
} }
static get targetPlatformToImageSuffixMap() { static get targetPlatformToImageSuffixMap() {
const { generic, webgl, mac, windows, android, ios, facebook } = ImageTag.imageSuffixes; const { generic, webgl, mac, windows, linux, android, ios, facebook } = ImageTag.imageSuffixes;
// @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html // @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html
return { return {
[Platform.types.StandaloneOSX]: mac, [Platform.types.StandaloneOSX]: mac,
[Platform.types.StandaloneWindows]: windows, [Platform.types.StandaloneWindows]: windows,
[Platform.types.StandaloneWindows64]: windows, [Platform.types.StandaloneWindows64]: windows,
[Platform.types.StandaloneLinux64]: windows, [Platform.types.StandaloneLinux64]: linux,
[Platform.types.iOS]: ios, [Platform.types.iOS]: ios,
[Platform.types.Android]: android, [Platform.types.Android]: android,
[Platform.types.WebGL]: webgl, [Platform.types.WebGL]: webgl,
@ -87,7 +88,7 @@ class ImageTag {
return this.customImage; return this.customImage;
} }
return `${image}:${tag}`; return `${image}:${tag}-0`; // '0' here represents the docker repo version
} }
} }

View File

@ -10,9 +10,9 @@ describe('UnityImageVersion', () => {
}; };
const defaults = { const defaults = {
repository: 'gableroux', repository: 'unityci',
name: 'unity3d', name: 'editor',
image: 'gableroux/unity3d', image: 'unityci/editor',
}; };
describe('constructor', () => { describe('constructor', () => {
@ -49,7 +49,7 @@ describe('UnityImageVersion', () => {
it('returns the correct version', () => { it('returns the correct version', () => {
const image = new ImageTag({ version: '2099.1.1111', platform: some.platform }); const image = new ImageTag({ version: '2099.1.1111', platform: some.platform });
expect(image.toString()).toStrictEqual(`${defaults.image}:2099.1.1111`); expect(image.toString()).toStrictEqual(`${defaults.image}:2099.1.1111-0`);
}); });
it('returns customImage if given', () => { it('returns customImage if given', () => {
const image = new ImageTag({ const image = new ImageTag({
@ -64,13 +64,13 @@ describe('UnityImageVersion', () => {
it('returns the specific build platform', () => { it('returns the specific build platform', () => {
const image = new ImageTag({ version: '2019.2.11f1', platform: 'WebGL' }); const image = new ImageTag({ version: '2019.2.11f1', platform: 'WebGL' });
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-webgl`); expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-webgl-0`);
}); });
it('returns no specific build platform for generic targetPlatforms', () => { it('returns no specific build platform for generic targetPlatforms', () => {
const image = new ImageTag({ platform: 'NoTarget' }); const image = new ImageTag({ platform: 'NoTarget' });
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1`); expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-0`);
}); });
}); });
}); });