Alin correct ancillary workflow
parent
8694f1a134
commit
1ed83c429d
|
@ -1,4 +1,4 @@
|
||||||
name: Get the Unity version required from a UPM Package.json file
|
name: Get the Package version from a UPM Package.json file
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
@ -11,21 +11,21 @@ on:
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
unityversion:
|
packageversion:
|
||||||
description: "Returns the version of Unity the UPM package requires"
|
description: "Returns the version of the UPM package"
|
||||||
value: ${{ jobs.get_unity_version.outputs.upmunityversion }}
|
value: ${{ jobs.get_package_version.outputs.upmpackageversion }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get_unity_version:
|
get_package_version:
|
||||||
name: Get required Unity version from UPM Package
|
name: Get required Package version from UPM Package
|
||||||
runs-on: ${{ inputs.build-host }}
|
runs-on: ${{ inputs.build-host }}
|
||||||
outputs:
|
outputs:
|
||||||
upmunityversion: ${{ steps.getVersion.outputs.packageunityversion }}
|
upmpackageversion: ${{ steps.getVersion.outputs.packageversion }}
|
||||||
steps:
|
steps:
|
||||||
- name: Script Version
|
- name: Script Version
|
||||||
run: |
|
run: |
|
||||||
echo "::group::Script Versioning"
|
echo "::group::Script Versioning"
|
||||||
$scriptVersion = "1.0.2"
|
$scriptVersion = "1.0.0"
|
||||||
echo "Build Script Version: $scriptVersion"
|
echo "Build Script Version: $scriptVersion"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
@ -34,7 +34,7 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
clean: true
|
clean: true
|
||||||
- id: getVersion
|
- id: getVersion
|
||||||
name: 'Get Unity Version Number'
|
name: 'Get Package Version Number'
|
||||||
run: |
|
run: |
|
||||||
echo "::group::Validating input"
|
echo "::group::Validating input"
|
||||||
|
|
||||||
|
@ -53,20 +53,18 @@ jobs:
|
||||||
|
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::Unity Version UPM check"
|
echo "::group::Package Version UPM check"
|
||||||
|
|
||||||
$package_json = Get-Content -Path $versionFile | ConvertFrom-Json
|
$package_json = Get-Content -Path $versionFile | ConvertFrom-Json
|
||||||
$unityVersion = $package_json.unity
|
$packageVersion = $package_json.version
|
||||||
|
|
||||||
if($unityVersion.Length -lt 6) {
|
if([string]::IsNullOrEmpty($packageVersion)) {
|
||||||
echo "Error - Detected version is $unityVersion"
|
Write-Error "Project.json version number does not exist or is empty"
|
||||||
echo "Unity version is too short, please check your UPM package Unity setting"
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "packageunityversion=$unityVersion" >> $env:GITHUB_OUTPUT
|
echo "packageversion=$packageVersion" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "Detected version is $unityVersion"
|
echo "Detected version is $packageVersion"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
shell: pwsh
|
shell: pwsh
|
Loading…
Reference in New Issue