Skip to content

Commit

Permalink
Create UPM compliant packages in releases (#385)
Browse files Browse the repository at this point in the history
* Enable UPM packages to be generated in releases

* Travis OSX package should already contain zip package

* Remove draft=true for releases deployment
  • Loading branch information
ei2kpi-ptc authored and Blake Gross committed Apr 3, 2019
1 parent 67eb55e commit f92ce09
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ _pkginfo.txt
!*.[Cc]ache/

*.orig

# Current_Package folder
current-package/
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions scripts/export-upm-package.sh
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
@@ -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": {}
}

0 comments on commit f92ce09

Please sign in to comment.