Skip to content

Commit

Permalink
Merge branch 'BLaZeKiLL-fix/unity-alias' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
webbertakken committed Nov 1, 2020
2 parents 17c2899 + 6c2fbff commit 471bf0b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 51 deletions.
2 changes: 1 addition & 1 deletion action/index.js

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions action/steps/activate.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then
fi

# Activate license
ACTIVATION_OUTPUT=$(xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
ACTIVATION_OUTPUT=$(unity-editor \
-batchmode \
-nographics \
-logFile /dev/stdout \
Expand Down Expand Up @@ -63,15 +62,14 @@ elif [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then
echo "Requesting activation (professional license)"

# Activate license
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-batchmode \
-nographics \
-logFile /dev/stdout \
-quit \
-serial "$UNITY_SERIAL" \
-username "$UNITY_EMAIL" \
-password "$UNITY_PASSWORD"
unity-editor \
-batchmode \
-nographics \
-logFile /dev/stdout \
-quit \
-serial "$UNITY_SERIAL" \
-username "$UNITY_EMAIL" \
-password "$UNITY_PASSWORD"

# Store the exit code from the verify command
UNITY_EXIT_CODE=$?
Expand Down
37 changes: 18 additions & 19 deletions action/steps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,24 @@ echo "# Building platform #"
echo "###########################"
echo ""

xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-batchmode \
-nographics \
-logfile /dev/stdout \
-quit \
-customBuildName "$BUILD_NAME" \
-projectPath "$UNITY_PROJECT_PATH" \
-buildTarget "$BUILD_TARGET" \
-customBuildTarget "$BUILD_TARGET" \
-customBuildPath "$CUSTOM_BUILD_PATH" \
-executeMethod "$BUILD_METHOD" \
-buildVersion "$VERSION" \
-androidVersionCode "$ANDROID_VERSION_CODE" \
-androidKeystoreName "$ANDROID_KEYSTORE_NAME" \
-androidKeystorePass "$ANDROID_KEYSTORE_PASS" \
-androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \
-androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \
$CUSTOM_PARAMETERS
unity-editor \
-batchmode \
-nographics \
-logfile /dev/stdout \
-quit \
-customBuildName "$BUILD_NAME" \
-projectPath "$UNITY_PROJECT_PATH" \
-buildTarget "$BUILD_TARGET" \
-customBuildTarget "$BUILD_TARGET" \
-customBuildPath "$CUSTOM_BUILD_PATH" \
-executeMethod "$BUILD_METHOD" \
-buildVersion "$VERSION" \
-androidVersionCode "$ANDROID_VERSION_CODE" \
-androidKeystoreName "$ANDROID_KEYSTORE_NAME" \
-androidKeystorePass "$ANDROID_KEYSTORE_PASS" \
-androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \
-androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \
$CUSTOM_PARAMETERS

# Catch exit code
BUILD_EXIT_CODE=$?
Expand Down
13 changes: 6 additions & 7 deletions action/steps/return_license.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ if [[ -n "$UNITY_SERIAL" ]]; then
#
# This will return the license that is currently in use.
#
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
/opt/Unity/Editor/Unity \
-batchmode \
-nographics \
-logFile /dev/stdout \
-quit \
-returnlicense
unity-editor \
-batchmode \
-nographics \
-logFile /dev/stdout \
-quit \
-returnlicense
fi
15 changes: 8 additions & 7 deletions src/model/image-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Platform from './platform';
class ImageTag {
constructor(imageProperties) {
const {
repository = 'gableroux',
name = 'unity3d',
repository = 'unityci',
name = 'editor',
version = '2019.2.11f1',
platform,
customImage,
Expand Down Expand Up @@ -36,23 +36,24 @@ class ImageTag {
return {
generic: '',
webgl: 'webgl',
mac: 'mac',
windows: 'windows',
mac: 'mac-mono',
windows: 'windows-mono',
linux: 'base',
android: 'android',
ios: 'ios',
facebook: 'facebook',
};
}

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
return {
[Platform.types.StandaloneOSX]: mac,
[Platform.types.StandaloneWindows]: windows,
[Platform.types.StandaloneWindows64]: windows,
[Platform.types.StandaloneLinux64]: windows,
[Platform.types.StandaloneLinux64]: linux,
[Platform.types.iOS]: ios,
[Platform.types.Android]: android,
[Platform.types.WebGL]: webgl,
Expand Down Expand Up @@ -87,7 +88,7 @@ class ImageTag {
return this.customImage;
}

return `${image}:${tag}`;
return `${image}:${tag}-0`; // '0' here represents the docker repo version
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/model/image-tag.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('UnityImageVersion', () => {
};

const defaults = {
repository: 'gableroux',
name: 'unity3d',
image: 'gableroux/unity3d',
repository: 'unityci',
name: 'editor',
image: 'unityci/editor',
};

describe('constructor', () => {
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('UnityImageVersion', () => {
it('returns the correct version', () => {
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', () => {
const image = new ImageTag({
Expand All @@ -64,13 +64,13 @@ describe('UnityImageVersion', () => {
it('returns the specific build platform', () => {
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', () => {
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`);
});
});
});

0 comments on commit 471bf0b

Please sign in to comment.