From f92ce098109810f3496f1d153d5c68881f30fdfa Mon Sep 17 00:00:00 2001 From: Varun Mani <44373229+ei2kpi-ptc@users.noreply.github.com> Date: Wed, 3 Apr 2019 14:00:52 -0400 Subject: [PATCH] Create UPM compliant packages in releases (#385) * Enable UPM packages to be generated in releases * Travis OSX package should already contain zip package * Remove draft=true for releases deployment --- .gitignore | 3 +++ .travis.yml | 6 ++++- scripts/export-upm-package.sh | 41 +++++++++++++++++++++++++++++++++++ scripts/package.json | 15 +++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 scripts/export-upm-package.sh create mode 100644 scripts/package.json diff --git a/.gitignore b/.gitignore index a662f55b5..f91f9cb77 100644 --- a/.gitignore +++ b/.gitignore @@ -150,3 +150,6 @@ _pkginfo.txt !*.[Cc]ache/ *.orig + +# Current_Package folder +current-package/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 034f029f0..2b4b2855d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,16 @@ 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-upm-package.sh" - "./scripts/export-unity-package.sh" deploy: provider: releases - file: "./current-package/UnityGLTF.unitypackage" + file: + - "./current-package/UnityGLTF.unitypackage" + - "./current-package/org.khronos.UnityGLTF.zip" skip_cleanup: true on: repo: KhronosGroup/UnityGLTF diff --git a/scripts/export-upm-package.sh b/scripts/export-upm-package.sh new file mode 100644 index 000000000..d1fcc202b --- /dev/null +++ b/scripts/export-upm-package.sh @@ -0,0 +1,41 @@ +#! /bin/sh + +project_path=$(pwd)/UnityGLTF +log_file=$(pwd)/build/unity-mac.log + +cached_folder=$(pwd) +upm_name=org.khronos.UnityGLTF +upm_src_folder_path=$(pwd)/UnityGLTF/Assets/UnityGLTF +upm_manifest_path=$(pwd)/scripts/package.json +upm_staging_path=$(pwd)/current-package/$upm_name +upm_zip_export_path=$(pwd)/current-package/$upm_name.zip +upm_targz_export_path=$(pwd)/current-package/$upm_name.tar.gz + +error_code=0 +echo $upm_name +echo $upm_src_folder_path +echo $upm_manifest_path +echo $upm_staging_path + +echo "Creating package folder" +mkdir $upm_staging_path +echo "Copying package.json" +cp $upm_manifest_path $upm_staging_path + +echo "Copying package contents from $upm_src_folder_path" +cp -r $upm_src_folder_path $upm_staging_path + +echo "Changing to $upm_staging_path folder" +cd $upm_staging_path + +echo "Creating .zip of UPM package" +sudo zip -r $upm_zip_export_path ./ + +echo "Creating .tar.gz of UPM package" +tar -zcvf $upm_targz_export_path ./ + +echo "Changing back to original folder $cached_folder" +cd $cached_folder + +echo "Finishing with code $error_code" +exit $error_code \ No newline at end of file diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 000000000..dfbb44b38 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,15 @@ +{ + "name": "org.khronos.unitygltf", + "displayName": "Khronos GLTF Loader", + "version": "1.0.0", + "unity": "2018.3", + "description": "Unity3D library for importing and exporting GLTF 2.0 assets. https://github.com/KhronosGroup/UnityGLTF", + "keywords": [ + "gltf", + "khronos", + "runtime", + "loader" + ], + "author": "Khronos Group", + "dependencies": {} +}