Skip to content

Commit d6fbf47

Browse files
committed
Fix yamato building on master
1 parent c8b8ec1 commit d6fbf47

File tree

10 files changed

+41
-19
lines changed

10 files changed

+41
-19
lines changed

.yamato/build.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,9 @@ build:
1212
commands:
1313
- powershell scripts\Get-Deps.ps1
1414
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
15-
- |
16-
set RELEASE=0
17-
if "x%GIT_TAG%"!==!"x" set RELEASE=1
18-
if "%RELEASE%"=="1" (build -r -p) else (build -r)
19-
- |
20-
set RELEASE=0
21-
if "x%GIT_TAG%"!==!"x" set RELEASE=1
22-
if "%RELEASE%"=="1" (test -r -p) else (test -r)
23-
- |
24-
set RELEASE=0
25-
if "x%GIT_TAG%"!==!"x" set RELEASE=1
26-
if "%RELEASE%"=="1" (pack -r -p -u) else (pack -r -u)
15+
- build.cmd
16+
- test.cmd
17+
- pack.cmd -u
2718

2819
artifacts:
2920
nuget:

.yamato/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ publish_npm:
3232
AUTH_URL: https://artifactory.internal.unity3d.com/api/npm/auth
3333

3434
commands:
35-
- curl -u%ARTIFACTORY% %AUTH_URL%/auth > %USERPROFILE%\.npmrc
35+
- |
36+
@echo off
37+
curl -u%ARTIFACTORY% %AUTH_URL% > %USERPROFILE%\.npmrc
3638
- for /f "delims=" %%d in ('dir /b "upm-ci~\packages\*.tgz"') do (call npm publish "upm-ci~\packages\%%d" --quiet --registry %PUBLISH_URL%)
3739

3840
dependencies:

.yamato/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ test_{{ platform.name }}_{{ editor.version }}:
88
type: {{ platform.type }}
99
image: {{ platform.image }}
1010
flavor: {{ platform.flavor}}
11-
variables:
12-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1311

1412
commands:
1513
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm

build.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
@echo off
22
setlocal
33

4+
if NOT "x%YAMATO_JOB_ID%"=="x" set GITLAB_CI=1
5+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_TAG=%GIT_TAG%
6+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_REF_NAME=%GIT_BRANCH%
7+
48
SET CONFIGURATION=Release
59
SET PUBLIC=""
610
SET BUILD=0

build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ while (( "$#" )); do
3939
echo "Error: Unsupported flag $1" >&2
4040
exit 1
4141
;;
42+
*)
43+
shift
44+
;;
4245
esac
4346
done
4447

pack.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
@echo off
22
setlocal
33

4+
if NOT "x%YAMATO_JOB_ID%"=="x" set GITLAB_CI=1
5+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_TAG=%GIT_TAG%
6+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_REF_NAME=%GIT_BRANCH%
7+
48
SET CONFIGURATION=Release
59
SET PUBLIC=""
610
SET BUILD=0

pack.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ while (( "$#" )); do
3939
echo "Error: Unsupported flag $1" >&2
4040
exit 1
4141
;;
42+
*)
43+
shift
44+
;;
4245
esac
4346
done
4447

scripts/Test-Upm.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[CmdletBinding()]
22
Param(
3+
[string]
4+
$UnityVersion = "2019.2",
35
[switch]
46
$Trace = $false
57
)
@@ -17,5 +19,5 @@ Get-ChildItem -Directory $upmDir | % {
1719
Write-Output "Testing $($_.Name)"
1820

1921
$packageDir = Join-Path $upmDir $_.Name
20-
Invoke-Command -Fatal { & upm-ci package test --package-path $packageDir -u 2019.2 }
22+
Invoke-Command -Fatal { & upm-ci package test --package-path $packageDir -u $UnityVersion }
2123
}

test.cmd

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
@echo off
22
setlocal
33

4+
if NOT "x%YAMATO_JOB_ID%"=="x" set GITLAB_CI=1
5+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_TAG=%GIT_TAG%
6+
if NOT "x%YAMATO_JOB_ID%"=="x" set CI_COMMIT_REF_NAME=%GIT_BRANCH%
7+
48
SET CONFIGURATION=Release
59
SET PUBLIC=""
610
SET BUILD=0
711
set UPM=0
12+
set UNITYVERSION=2019.2
813

914
:loop
1015
IF NOT "%1"=="" (
@@ -34,9 +39,13 @@ IF NOT "%1"=="" (
3439
)
3540
IF "%1"=="-u" (
3641
SET UPM=1
42+
SHIFT
43+
SET UNITYVERSION=%1
3744
)
3845
IF "%1"=="--upm" (
3946
SET UPM=1
47+
SHIFT
48+
SET UNITYVERSION=%1
4049
)
4150
SHIFT
4251
GOTO :loop
@@ -46,8 +55,8 @@ if "x%BUILD%"=="x1" (
4655
dotnet restore
4756
dotnet build --no-restore -c %CONFIGURATION% %PUBLIC%
4857
)
49-
dotnet test --no-build --no-restore -c %CONFIGURATION% %PUBLIC% --logger "trx;LogFileName=dotnet-test-result.trx" --logger "html;LogFileName=dotnet-test-result.html"
58+
dotnet test --no-build --no-restore -c %CONFIGURATION% %PUBLIC% --logger "trx;LogFileName=dotnet-test-result.trx"
5059

5160
if "x%UPM%"=="x1" (
52-
call powershell scripts/Test-Upm.ps1
61+
call powershell scripts/Test-Upm.ps1 -UnityVersion %UNITYVERSION%
5362
)

test.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CONFIGURATION=Release
1212
PUBLIC=""
1313
BUILD=0
1414
UPM=0
15+
UNITYVERSION=2019.2
1516

1617
while (( "$#" )); do
1718
case "$1" in
@@ -34,11 +35,16 @@ while (( "$#" )); do
3435
-u|--upm)
3536
UPM=1
3637
shift
38+
UNITYVERSION=$1
39+
shift
3740
;;
3841
-*|--*=) # unsupported flags
3942
echo "Error: Unsupported flag $1" >&2
4043
exit 1
4144
;;
45+
*)
46+
shift
47+
;;
4248
esac
4349
done
4450

@@ -55,7 +61,7 @@ fi
5561
dotnet test --no-build --no-restore -c $CONFIGURATION $PUBLIC --logger "trx;LogFileName=dotnet-test-result.trx" --logger "html;LogFileName=dotnet-test-result.html"
5662

5763
if [[ x"$UPM" == x"1" ]]; then
58-
powershell scripts/Test-Upm.ps1
64+
powershell scripts/Test-Upm.ps1 -UnityVersion $UNITYVERSION
5965
fi
6066

6167
popd >/dev/null 2>&1

0 commit comments

Comments
 (0)