Skip to content

Commit 5d9cc00

Browse files
- fixed Linux install logging format - fixed additional Linux dep installation to choose correct arch for package - fix UNITY_EDITORS variable string escape
1 parent bb67d2b commit 5d9cc00

File tree

9 files changed

+33
-49
lines changed

9 files changed

+33
-49
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
build-targets: ${{ matrix.build-targets }}
3232
modules: ${{ matrix.modules }}
3333
- run: |
34-
echo "UNITY_HUB_PATH: '${{ env.UNITY_HUB_PATH }}'"
35-
echo "UNITY_EDITORS: '${{ env.UNITY_EDITORS }}'"
36-
echo "UNITY_EDITOR_PATH: '${{ env.UNITY_EDITOR_PATH }}'"
37-
echo "UNITY_PROJECT_PATH: '${{ env.UNITY_PROJECT_PATH }}'"
34+
echo 'UNITY_HUB_PATH: ${{ env.UNITY_HUB_PATH }}'
35+
echo 'UNITY_EDITORS: ${{ env.UNITY_EDITORS }}'
36+
echo 'UNITY_EDITOR_PATH: ${{ env.UNITY_EDITOR_PATH }}'
37+
echo 'UNITY_PROJECT_PATH: ${{ env.UNITY_PROJECT_PATH }}'
3838
# If unity-version is None, UNITY_EDITOR_PATH must be empty
3939
if [[ "${{ matrix.unity-version }}" == "None" ]]; then
4040
if [[ -n "${{ env.UNITY_EDITOR_PATH }}" ]]; then

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36234,7 +36234,6 @@ async function installUnity(unityVersion, modules) {
3623436234
if (unityVersion.isLegacy()) {
3623536235
return await installUnity4x(unityVersion);
3623636236
}
36237-
core.startGroup(`Installing Unity ${unityVersion.toString()}...`);
3623836237
if (process.platform === 'linux') {
3623936238
const installLinuxDepsScript = __nccwpck_require__.ab + "install-linux-dependencies.sh";
3624036239
const exitCode = await exec.exec('bash', [__nccwpck_require__.ab + "install-linux-dependencies.sh", unityVersion.version], {
@@ -36258,6 +36257,7 @@ async function installUnity(unityVersion, modules) {
3625836257
}
3625936258
args.push('--cm');
3626036259
}
36260+
core.startGroup(`Installing Unity ${unityVersion.toString()}...`);
3626136261
try {
3626236262
const output = await execUnityHub(args);
3626336263
if (output.includes(`Error while installing an editor or a module from changeset`)) {
@@ -47295,7 +47295,7 @@ const main = async () => {
4729547295
if (installedEditors.length !== versions.length) {
4729647296
throw new Error(`Expected to install ${versions.length} Unity versions, but installed ${installedEditors.length}.`);
4729747297
}
47298-
core.exportVariable('UNITY_EDITORS', JSON.stringify(Object.fromEntries(installedEditors.map(e => [e.version, e.path]))));
47298+
core.exportVariable('UNITY_EDITORS', Object.fromEntries(installedEditors.map(e => [e.version, e.path])));
4729947299
core.info('Unity Setup Complete!');
4730047300
process.exit(0);
4730147301
}

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/install-linux-dependencies.sh

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,22 @@
44
set -e
55

66
unityVersion="$1"
7+
arch="$(dpkg --print-architecture)"
78

89
if [ -z "$unityVersion" ]; then
910
echo "Usage: $0 <unity-version>"
1011
exit 1
1112
fi
1213

13-
echo "::group::Installing additional dependencies for Unity $unityVersion..."
14-
15-
# Unity 2019.{1,2}
1614
case "$unityVersion" in
1715
2019.1.*|2019.2.*)
18-
curl -LO https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
19-
sudo dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
20-
rm libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
21-
;;
22-
esac
23-
24-
# Unity 2019.{3,4}/2020.*
25-
case "$unityVersion" in
16+
curl -LO "https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
17+
sudo dpkg -i "libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
18+
rm "libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
19+
;;
2620
2019.3.*|2019.4.*|2020.*)
27-
curl -LO https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
28-
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
29-
rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb
30-
;;
31-
esac
32-
33-
echo "::endgroup::"
21+
curl -LO "https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
22+
sudo dpkg -i "libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
23+
rm "libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
24+
;;
25+
esac

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const main = async () => {
3636
throw new Error(`Expected to install ${versions.length} Unity versions, but installed ${installedEditors.length}.`);
3737
}
3838

39-
core.exportVariable('UNITY_EDITORS', JSON.stringify(Object.fromEntries(installedEditors.map(e => [e.version, e.path]))));
39+
core.exportVariable('UNITY_EDITORS', Object.fromEntries(installedEditors.map(e => [e.version, e.path])));
4040
core.info('Unity Setup Complete!');
4141
process.exit(0);
4242
} catch (error) {

src/install-linux-dependencies.sh

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,22 @@
44
set -e
55

66
unityVersion="$1"
7+
arch="$(dpkg --print-architecture)"
78

89
if [ -z "$unityVersion" ]; then
910
echo "Usage: $0 <unity-version>"
1011
exit 1
1112
fi
1213

13-
echo "::group::Installing additional dependencies for Unity $unityVersion..."
14-
15-
# Unity 2019.{1,2}
1614
case "$unityVersion" in
1715
2019.1.*|2019.2.*)
18-
curl -LO https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
19-
sudo dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
20-
rm libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
21-
;;
22-
esac
23-
24-
# Unity 2019.{3,4}/2020.*
25-
case "$unityVersion" in
16+
curl -LO "https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
17+
sudo dpkg -i "libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
18+
rm "libssl1.0.0_1.0.2g-1ubuntu4.20_${arch}.deb"
19+
;;
2620
2019.3.*|2019.4.*|2020.*)
27-
curl -LO https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
28-
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
29-
rm libssl1.1_1.1.0g-2ubuntu4_amd64.deb
30-
;;
31-
esac
32-
33-
echo "::endgroup::"
21+
curl -LO "https://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
22+
sudo dpkg -i "libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
23+
rm "libssl1.1_1.1.0g-2ubuntu4_${arch}.deb"
24+
;;
25+
esac

src/unity-hub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ async function installUnity(unityVersion: UnityVersion, modules: string[]): Prom
415415
return await installUnity4x(unityVersion);
416416
}
417417

418-
core.startGroup(`Installing Unity ${unityVersion.toString()}...`);
419-
420418
if (process.platform === 'linux') {
421419
const installLinuxDepsScript = path.join(__dirname, 'install-linux-dependencies.sh');
422420
const exitCode = await exec.exec('bash', [installLinuxDepsScript, unityVersion.version], {
@@ -447,6 +445,8 @@ async function installUnity(unityVersion: UnityVersion, modules: string[]): Prom
447445
args.push('--cm');
448446
}
449447

448+
core.startGroup(`Installing Unity ${unityVersion.toString()}...`);
449+
450450
try {
451451
const output = await execUnityHub(args);
452452
if (output.includes(`Error while installing an editor or a module from changeset`)) {

0 commit comments

Comments
 (0)