mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-04 16:19:09 +08:00
Compare commits
6 Commits
v2.0-alpha
...
v2.0-alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0e18ea3a5 | ||
|
|
947c8b8e20 | ||
|
|
a5de621fe2 | ||
|
|
e31af20466 | ||
|
|
a1f68ab26c | ||
|
|
e13a9f51e9 |
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an improvement or now feature
|
about: Suggest an improvement, or a new feature
|
||||||
title: ''
|
title: ''
|
||||||
labels: ''
|
labels: ''
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ inputs:
|
|||||||
|
|
||||||
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
|
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
|
||||||
Parameters without a value will be considered booleans (with a value of true).
|
Parameters without a value will be considered booleans (with a value of true).
|
||||||
|
chownFilesTo:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
||||||
allowDirtyBuild:
|
allowDirtyBuild:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|||||||
@@ -53,14 +53,11 @@ namespace UnityBuilderAction
|
|||||||
if (addressableAssetSettingsType != null)
|
if (addressableAssetSettingsType != null)
|
||||||
{
|
{
|
||||||
// ReSharper disable once PossibleNullReferenceException, used from try-catch
|
// ReSharper disable once PossibleNullReferenceException, used from try-catch
|
||||||
void CallAddressablesMethod(string methodName, object[] args) => addressableAssetSettingsType
|
|
||||||
.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public)
|
|
||||||
.Invoke(null, args);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CallAddressablesMethod("CleanPlayerContent", new object[] { null });
|
addressableAssetSettingsType.GetMethod("CleanPlayerContent", BindingFlags.Static | BindingFlags.Public)
|
||||||
CallAddressablesMethod("BuildPlayerContent", Array.Empty<object>());
|
.Invoke(null, new object[] {null});
|
||||||
|
addressableAssetSettingsType.GetMethod("BuildPlayerContent", new Type[0]).Invoke(null, new object[0]);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
1008
dist/index.js
generated
vendored
1008
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
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
48
dist/steps/build.sh
vendored
48
dist/steps/build.sh
vendored
@@ -65,6 +65,7 @@ fi
|
|||||||
#
|
#
|
||||||
# Create Android keystore, if needed
|
# Create Android keystore, if needed
|
||||||
#
|
#
|
||||||
|
|
||||||
if [[ -z $ANDROID_KEYSTORE_NAME || -z $ANDROID_KEYSTORE_BASE64 ]]; then
|
if [[ -z $ANDROID_KEYSTORE_NAME || -z $ANDROID_KEYSTORE_BASE64 ]]; then
|
||||||
echo "Not creating Android keystore."
|
echo "Not creating Android keystore."
|
||||||
else
|
else
|
||||||
@@ -73,16 +74,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Display custom parameters
|
# Pre-build debug information
|
||||||
#
|
#
|
||||||
echo "Using custom parameters $CUSTOM_PARAMETERS."
|
|
||||||
|
|
||||||
# The build specification below may require Unity 2019.2.11f1 or later (not tested below).
|
echo ""
|
||||||
# Reference: https://docs.unity3d.com/2019.3/Documentation/Manual/CommandLineArguments.html
|
echo "###########################"
|
||||||
|
echo "# Custom parameters #"
|
||||||
|
echo "###########################"
|
||||||
|
echo ""
|
||||||
|
|
||||||
#
|
echo "$CUSTOM_PARAMETERS"
|
||||||
# Build info
|
|
||||||
#
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
@@ -100,14 +101,20 @@ echo "# Project directory #"
|
|||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
ls -alh $UNITY_PROJECT_PATH
|
ls -alh "$UNITY_PROJECT_PATH"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build
|
||||||
|
#
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo "# Building platform #"
|
echo "# Building project #"
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Reference: https://docs.unity3d.com/2019.3/Documentation/Manual/CommandLineArguments.html
|
||||||
|
|
||||||
unity-editor \
|
unity-editor \
|
||||||
-nographics \
|
-nographics \
|
||||||
-logfile /dev/stdout \
|
-logfile /dev/stdout \
|
||||||
@@ -136,11 +143,24 @@ else
|
|||||||
echo "Build failed, with exit code $BUILD_EXIT_CODE";
|
echo "Build failed, with exit code $BUILD_EXIT_CODE";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add permissions to make app runnable
|
#
|
||||||
|
# Permissions
|
||||||
|
#
|
||||||
|
|
||||||
|
# Make a given user owner of all artifacts
|
||||||
|
if [[ -n "$CHOWN_FILES_TO" ]]; then
|
||||||
|
chown -R "$CHOWN_FILES_TO" "$BUILD_PATH_FULL"
|
||||||
|
chown -R "$CHOWN_FILES_TO" "$UNITY_PROJECT_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add read permissions for everyone to all artifacts
|
||||||
|
chmod -R a+r "$BUILD_PATH_FULL"
|
||||||
|
chmod -R a+r "$UNITY_PROJECT_PATH"
|
||||||
|
|
||||||
|
# Add execute permissions to specific files
|
||||||
if [[ "$BUILD_TARGET" == "StandaloneOSX" ]]; then
|
if [[ "$BUILD_TARGET" == "StandaloneOSX" ]]; then
|
||||||
ADD_PERMISSIONS_PATH=$BUILD_PATH_FULL/StandaloneOSX.app/Contents/MacOS/*
|
OSX_EXECUTABLE_PATH="$BUILD_PATH_FULL/StandaloneOSX.app/Contents/MacOS/*"
|
||||||
echo "Making the following path executable: $ADD_PERMISSIONS_PATH"
|
chmod +x "$OSX_EXECUTABLE_PATH"
|
||||||
chmod +x $ADD_PERMISSIONS_PATH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -149,7 +169,7 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo "# Build directory #"
|
echo "# Build output #"
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
|
|||||||
buildMethod: undefined,
|
buildMethod: undefined,
|
||||||
buildVersion: '1.3.37',
|
buildVersion: '1.3.37',
|
||||||
customParameters: '',
|
customParameters: '',
|
||||||
|
chownFilesTo: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class AWS {
|
|||||||
apk add git-lfs;
|
apk add git-lfs;
|
||||||
apk add jq;
|
apk add jq;
|
||||||
# Get source repo for project to be built and game-ci repo for utilties
|
# Get source repo for project to be built and game-ci repo for utilties
|
||||||
git clone https://${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git ${buildUid}/${repositoryDirectoryName} -q
|
git clone https://${buildParameters.githubToken}@github.com/${process.env.GITHUB_REPOSITORY}.git ${buildUid}/${repositoryDirectoryName} -q
|
||||||
git clone https://${process.env.GITHUB_TOKEN}@github.com/game-ci/unity-builder.git ${buildUid}/builder -q
|
git clone https://${buildParameters.githubToken}@github.com/game-ci/unity-builder.git ${buildUid}/builder -q
|
||||||
cd /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/
|
cd /${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/
|
||||||
git checkout $GITHUB_SHA
|
git checkout $GITHUB_SHA
|
||||||
cd /${efsDirectoryName}/
|
cd /${efsDirectoryName}/
|
||||||
@@ -149,6 +149,10 @@ class AWS {
|
|||||||
name: 'CUSTOM_PARAMETERS',
|
name: 'CUSTOM_PARAMETERS',
|
||||||
value: buildParameters.customParameters,
|
value: buildParameters.customParameters,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'CHOWN_FILES_TO',
|
||||||
|
value: buildParameters.chownFilesTo,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'BUILD_TARGET',
|
name: 'BUILD_TARGET',
|
||||||
value: buildParameters.platform,
|
value: buildParameters.platform,
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class BuildParameters {
|
|||||||
androidKeyaliasName: Input.androidKeyaliasName,
|
androidKeyaliasName: Input.androidKeyaliasName,
|
||||||
androidKeyaliasPass: Input.androidKeyaliasPass,
|
androidKeyaliasPass: Input.androidKeyaliasPass,
|
||||||
customParameters: Input.customParameters,
|
customParameters: Input.customParameters,
|
||||||
|
chownFilesTo: Input.chownFilesTo,
|
||||||
remoteBuildCluster: Input.remoteBuildCluster,
|
remoteBuildCluster: Input.remoteBuildCluster,
|
||||||
awsStackName: Input.awsStackName,
|
awsStackName: Input.awsStackName,
|
||||||
kubeConfig: Input.kubeConfig,
|
kubeConfig: Input.kubeConfig,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class Docker {
|
|||||||
androidKeyaliasName,
|
androidKeyaliasName,
|
||||||
androidKeyaliasPass,
|
androidKeyaliasPass,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
chownFilesTo,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
const command = `docker run \
|
const command = `docker run \
|
||||||
@@ -62,6 +63,7 @@ class Docker {
|
|||||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
--env GITHUB_REF \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_REPOSITORY \
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ class Input {
|
|||||||
return core.getInput('customParameters') || '';
|
return core.getInput('customParameters') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get chownFilesTo() {
|
||||||
|
return core.getInput('chownFilesTo') || '';
|
||||||
|
}
|
||||||
|
|
||||||
static get remoteBuildCluster() {
|
static get remoteBuildCluster() {
|
||||||
return core.getInput('remoteBuildCluster') || '';
|
return core.getInput('remoteBuildCluster') || '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,6 +222,10 @@ class Kubernetes {
|
|||||||
name: 'CUSTOM_PARAMETERS',
|
name: 'CUSTOM_PARAMETERS',
|
||||||
value: this.buildParameters.customParameters,
|
value: this.buildParameters.customParameters,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'CHOWN_FILES_TO',
|
||||||
|
value: this.buildParameters.chownFilesTo,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'BUILD_TARGET',
|
name: 'BUILD_TARGET',
|
||||||
value: this.buildParameters.platform,
|
value: this.buildParameters.platform,
|
||||||
|
|||||||
@@ -251,8 +251,14 @@ export default class Versioning {
|
|||||||
*/
|
*/
|
||||||
static async isDirty() {
|
static async isDirty() {
|
||||||
const output = await this.git(['status', '--porcelain']);
|
const output = await this.git(['status', '--porcelain']);
|
||||||
|
const isDirty = output !== '';
|
||||||
|
|
||||||
return output !== '';
|
if (isDirty) {
|
||||||
|
core.warning('Changes were made to the following files and folders:\n');
|
||||||
|
core.warning(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
return isDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user