Skip to content

Commit

Permalink
Enable Azure Pipelines UPM releases (#2)
Browse files Browse the repository at this point in the history
* Update Export-upm-packages.sh to support Azure Pipelines
* Remove UPM Package generation from .travis.yml

UPM package generation now works with Azure Pipelines
  • Loading branch information
ei2kpi-ptc authored May 7, 2019
1 parent ee841ab commit 661944e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ install:
- sudo python2 ./scripts/install-unity.py --package Unity 2017.1.1f1
before_script:
- sudo chmod -R a+rwx /Applications/Unity
- sudo chmod +x ./scripts/export-upm-package.sh
script:
- msbuild ./GLTFSerialization/GLTFSerialization.sln /t:GLTFSerialization /p:TargetFramework=net35
- "./scripts/export-unity-package.sh"
- msbuild ./GLTFSerialization/GLTFSerialization.sln /t:GLTFSerialization
- "./scripts/export-upm-package.sh"
deploy:
provider: releases
file:
- "./current-package/UnityGLTF.unitypackage"
- "./current-package/org.khronos.UnityGLTF.zip"
skip_cleanup: true
on:
repo: KhronosGroup/UnityGLTF
branch: releases
tags: true
api-key:
secure: "KBs5cOzqEoTDzsBv6AurzlFMtgfctKbJWsGorUW9BE/+B8pnriGQxc1Lt83kzkvHkcF+MgqD5M1KK6SebB/lgpE2Xo/Zu/al1Sr0M6MNijRgHCx0aqea+/mjXfHS7qhbOqgEqQHYoR4kOqIKFhJZOohtLBylnDgFojG42Z2UFnbSelZaAT8qISxndX5qjIqV9+CgkRlpwyY4tnQ2fzVwuyFMvEqSBUzAegzPa+nQu1HgJzx64OP0ONmoTPJnUr0C741GtsD1fA6SMjSpwhjiYezQXapN2a/YoZufEkrd5wYq8Q1UVNMDmkmtg1zA0LkmK1u6dEhE7VCjxL7CW13FWGWEMKR9h2afTl+QkRIZxNRxjVHcWG122oTSCOXaAwBtNHMnWEgBy+DYFWAYD/bMmZ+g70EZ2/bFEfPprhyOvK59No5V65FOyoIMSBZvgU1z2Kl3PPTUl/0vEljX3RiON6BvIbOxU7OdR+OI35naSfos76YWK58+b99fRC0rJq6egwhNTACPItrtdmZq13k/5PWfGSJ0IAegdoXCB1eFP6SqcoXDsxLJph8/nHrEHqyjtl9PYBturvzVfQThTzL4FQuB7Fypwql/PXB7mdG7HkOvcM5jJWiupIsQxw5VkArZhnBk188ds+UC42tUhF701ZrPJz6GF0Kqem7/Fr/6l7A="

31 changes: 17 additions & 14 deletions scripts/export-upm-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@ log_file=$(pwd)/build/unity-mac.log

cached_folder=$(pwd)
upm_name=org.khronos.UnityGLTF
echo "##vso[task.setvariable variable=UPM_NAME]$upm_name"
upm_src_folder_path=$(pwd)/UnityGLTF/Assets/UnityGLTF
upm_manifest_path=$(pwd)/scripts/package.json
upm_staging_path=$(pwd)/current-package/$upm_name
upm_staging_UWP_plugins_path=$upm_staging_path/UnityGLTF/Plugins/uap10.0.10586
upm_zip_export_path=$(pwd)/current-package/$upm_name.zip
upm_targz_export_path=$(pwd)/current-package/$upm_name.tar.gz

if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* ]]; then
echo "Detected refs/tags in $BUILD_SOURCEBRANCH so this must be a tagged release build."
# Splits the string with "refs/tags", takes the second value and then
# swaps out any slashes for underscores
GIT_TAG=$(echo $BUILD_SOURCEBRANCH | awk -F'refs/tags/' '{print $2}' | tr '/' '_')
echo "Setting GIT_TAG variable to: $GIT_TAG"
echo "##vso[task.setvariable variable=GIT_TAG]$GIT_TAG"
else
echo "Did not detect refs/tags in $BUILD_SOURCEBRANCH so skipping GIT_TAG variable set"
fi

# msbuild spits out every single dependency dll for UWP
# These are the only files that are needed by the UPM package for Unity 2018.3+
# Including all the files in the UWP plugin directory causes name collision errors when
Expand Down Expand Up @@ -42,19 +54,10 @@ echo "Changing to $upm_staging_path folder"
cd $upm_staging_path

echo "Cleaning out UWP plugin DLLs that are not needed for Unity2018.3+"
echo "Only keeping the following files:"
printf '%s\n' "${upm_UWP_Plugins[@]}"
find $upm_staging_UWP_plugins_path -maxdepth 1 -type f | grep -vE "$(IFS=\| && echo "${upm_UWP_Plugins[*]}")" | xargs rm

echo "Creating .zip of UPM package"
sudo zip -q -r $upm_zip_export_path ./

echo "Creating .tar.gz of UPM package"
tar -zcf $upm_targz_export_path ./

echo "Changing back to original folder $cached_folder"
cd $cached_folder

echo "Finishing with code $error_code"
exit $error_code

echo "Files left in $upm_staging_UWP_plugins_path"
for entry in "$upm_staging_UWP_plugins_path"/*
do
echo "$entry"
done

0 comments on commit 661944e

Please sign in to comment.