1- name : Get the Unity version required from a UPM Package.json file
1+ name : Get the Package version from a UPM Package.json file
22
33on :
44 workflow_call :
1111 type : string
1212 required : false
1313 outputs :
14- unityversion :
15- description : " Returns the version of Unity the UPM package requires "
16- value : ${{ jobs.get_unity_version .outputs.upmunityversion }}
14+ packageversion :
15+ description : " Returns the version of the UPM package"
16+ value : ${{ jobs.get_package_version .outputs.upmpackageversion }}
1717
1818jobs :
19- get_unity_version :
20- name : Get required Unity version from UPM Package
19+ get_package_version :
20+ name : Get required Package version from UPM Package
2121 runs-on : ${{ inputs.build-host }}
2222 outputs :
23- upmunityversion : ${{ steps.getVersion.outputs.packageunityversion }}
23+ upmpackageversion : ${{ steps.getVersion.outputs.packageversion }}
2424 steps :
2525 - name : Script Version
2626 run : |
2727 echo "::group::Script Versioning"
28- $scriptVersion = "1.0.2 "
28+ $scriptVersion = "1.0.0 "
2929 echo "Build Script Version: $scriptVersion"
3030 echo "::endgroup::"
3131 shell : pwsh
3434 submodules : recursive
3535 clean : true
3636 - id : getVersion
37- name : ' Get Unity Version Number'
37+ name : ' Get Package Version Number'
3838 run : |
3939 echo "::group::Validating input"
4040
@@ -53,20 +53,18 @@ jobs:
5353
5454 echo "::endgroup::"
5555
56- echo "::group::Unity Version UPM check"
56+ echo "::group::Package Version UPM check"
5757
5858 $package_json = Get-Content -Path $versionFile | ConvertFrom-Json
59- $unityVersion = $package_json.unity
59+ $packageVersion = $package_json.version
6060
61- if($unityVersion.Length -lt 6) {
62- echo "Error - Detected version is $unityVersion"
63- echo "Unity version is too short, please check your UPM package Unity setting"
61+ if([string]::IsNullOrEmpty($packageVersion)) {
62+ Write-Error "Project.json version number does not exist or is empty"
6463 exit 1
6564 }
6665
67- echo "packageunityversion=$unityVersion " >> $env:GITHUB_OUTPUT
66+ echo "packageversion=$packageVersion " >> $env:GITHUB_OUTPUT
6867
69- echo "Detected version is $unityVersion "
68+ echo "Detected version is $packageVersion "
7069 echo "::endgroup::"
71-
7270 shell : pwsh
0 commit comments