Skip to content

Commit

Permalink
Merge pull request #464 from Unity-UI-Extensions/development
Browse files Browse the repository at this point in the history
Release 2.3.2 - take 4
  • Loading branch information
SimonDarksideJ authored Nov 26, 2023
2 parents 1427970 + 6f09750 commit 17835a6
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -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:
workflow_call:
Expand All @@ -11,21 +11,21 @@ on:
type: string
required: false
outputs:
unityversion:
description: "Returns the version of Unity the UPM package requires"
value: ${{ jobs.get_unity_version.outputs.upmunityversion }}
packageversion:
description: "Returns the version of the UPM package"
value: ${{ jobs.get_package_version.outputs.upmpackageversion }}

jobs:
get_unity_version:
name: Get required Unity version from UPM Package
get_package_version:
name: Get required Package version from UPM Package
runs-on: ${{ inputs.build-host }}
outputs:
upmunityversion: ${{ steps.getVersion.outputs.packageunityversion }}
upmpackageversion: ${{ steps.getVersion.outputs.packageversion }}
steps:
- name: Script Version
run: |
echo "::group::Script Versioning"
$scriptVersion = "1.0.2"
$scriptVersion = "1.0.0"
echo "Build Script Version: $scriptVersion"
echo "::endgroup::"
shell: pwsh
Expand All @@ -34,7 +34,7 @@ jobs:
submodules: recursive
clean: true
- id: getVersion
name: 'Get Unity Version Number'
name: 'Get Package Version Number'
run: |
echo "::group::Validating input"
Expand All @@ -53,20 +53,18 @@ jobs:
echo "::endgroup::"
echo "::group::Unity Version UPM check"
echo "::group::Package Version UPM check"
$package_json = Get-Content -Path $versionFile | ConvertFrom-Json
$unityVersion = $package_json.unity
$packageVersion = $package_json.version
if($unityVersion.Length -lt 6) {
echo "Error - Detected version is $unityVersion"
echo "Unity version is too short, please check your UPM package Unity setting"
if([string]::IsNullOrEmpty($packageVersion)) {
Write-Error "Project.json version number does not exist or is empty"
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::"
shell: pwsh

0 comments on commit 17835a6

Please sign in to comment.