Skip to content

Commit

Permalink
creating fusion3p
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Feb 21, 2024
1 parent ab9dec5 commit 44438a3
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
working-directory: ./build
assemble-sdk:
runs-on: ubuntu-20.04
needs: [build-windows-release, build-macos, build-linux-ubi8-gcc12]
needs: [build-windows-debug, build-windows-release, build-macos-debug, build-macos, build-linux-ubi8-gcc12]
steps:
- run: sudo apt install -y zip unzip
- run: mkdir build
Expand All @@ -215,11 +215,24 @@ jobs:
- run: unzip bindings.zip/bindings.zip
working-directory: ./build
- run: bash SDK/GenerateSDK_github.sh
- run: bash Fusion/Generate3P.sh
- name: Archive SDK artifact
uses: actions/upload-artifact@v2
with:
name: lib3mf_sdk.zip
path: build/lib3mf_sdk.zip
- uses: actions/upload-artifact@v2
with:
name: win64_0.zip
path: build/win64_0.zip
- uses: actions/upload-artifact@v2
with:
name: mac64_0.zip
path: build/mac64_0.zip
- uses: actions/upload-artifact@v2
with:
name: linux_0.zip
path: build/linux_0.zip
deploy-linux:
runs-on: ubuntu-20.04
needs: [assemble-sdk]
Expand Down
69 changes: 69 additions & 0 deletions Fusion/Generate3P.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash
export SDKARTIFACT=build/fusion3p

export LOCATION="build"

function failed {
echo "$1" 1>&2
exit 1;
}

echo Clean artifacts-folder $SDKARTIFACT
rm -rf $SDKARTIFACT
mkdir $SDKARTIFACT

mkdir $SDKARTIFACT/win64_0
mkdir $SDKARTIFACT/win64_0/headers
mkdir $SDKARTIFACT/win64_0/libs
mkdir $SDKARTIFACT/win64_0/libs/Debug
mkdir $SDKARTIFACT/win64_0/libs/Release
mkdir $SDKARTIFACT/win64_0/runtimeroots/Release

mkdir $SDKARTIFACT/mac64_0
mkdir $SDKARTIFACT/mac64_0/headers
mkdir $SDKARTIFACT/mac64_0/libs
mkdir $SDKARTIFACT/mac64_0/libs/Debug
mkdir $SDKARTIFACT/mac64_0/libs/Debug/lib3mf
mkdir $SDKARTIFACT/mac64_0/libs/Release
mkdir $SDKARTIFACT/mac64_0/libs/Release/lib3mf
mkdir $SDKARTIFACT/mac64_0/Frameworks
mkdir $SDKARTIFACT/mac64_0/Frameworks/Release
mkdir $SDKARTIFACT/mac64_0/Frameworks/Release/lib3mf

mkdir $SDKARTIFACT/linux_0
mkdir $SDKARTIFACT/linux_0/inc
mkdir $SDKARTIFACT/linux_0/lib


cp -r Autogenerated/Bindings/Cpp $SDKARTIFACT/win64_0/headers
cp -r Autogenerated/Bindings/CppDynamic $SDKARTIFACT/win64_0/headers

cp -r Autogenerated/Bindings/Cpp $SDKARTIFACT/mac64_0/headers
cp -r Autogenerated/Bindings/CppDynamic $SDKARTIFACT/mac64_0/headers

cp -r Autogenerated/Bindings/Cpp mkdir $SDKARTIFACT/linux_0/inc
cp -r Autogenerated/Bindings/CppDynamic mkdir $SDKARTIFACT/linux_0/inc


major_version =($grep -oPm1 "(?<=lib3mf\"\sversion=\")[^.]+" AutomaticComponentToolkit/lib3mf.xml)

echo Copy binaries
cp $LOCATION/lib3mf.dll/lib3mf.dll $SDKARTIFACT/win64_0/libs/Release/lib3mf.$major_version.dll || failed "Error copying binary"
cp $LOCATION/lib3mf.lib/lib3mf.lib $SDKARTIFACT/win64_0/libs/Release/lib3mf.$major_version.lib || failed "Error copying binary"
cp $LOCATION/lib3mf.debug.dll/lib3mf.debug.dll $SDKARTIFACT/win64_0/libs/Debug/lib3mf.$major_version.dll || failed "Error copying binary"
cp $LOCATION/lib3mf.debug.lib/lib3mf.debug.lib $SDKARTIFACT/win64_0/libs/Debug/lib3mf.$major_version.lib || failed "Error copying binary"
cp $LOCATION/lib3mf.pdb/lib3mf.pdb $SDKARTIFACT/win64_0/libs/Debug/lib3mf.$major_version.pdb || failed "Error copying binary"
cp $LOCATION/lib3mf.dll/lib3mf.dll $SDKARTIFACT/win64_0/runtimeroots/Release/lib3mf.$major_version.dll || failed "Error copying binary"


cp $LOCATION/lib3mf.dylib/lib3mf.dylib $SDKARTIFACT/mac64_0/libs/Release/lib3mf/lib3mf.$major_version.dylib || failed "Error copying binary"
cp $LOCATION/lib3mf.debug.dylib/lib3mf.debug.dylib $SDKARTIFACT/mac64_0/libs/Debug/lib3mf/lib3mf.$major_version.dylib || failed "Error copying binary"
cp $LOCATION/lib3mf.dylib/lib3mf.dylib $SDKARTIFACT/mac64_0/Frameworks/Release/lib3mf/lib3mf.$major_version.dylib || failed "Error copying binary"

cp $LOCATION/lib3mf.so/lib3mf.so.2 $SDKARTIFACT/linux_0/lib/lib3mf.$major_version.so || failed "Error copying binary"

echo Zip SDK artifacts
cd $SDKARTIFACT
zip -r ../win64_0.zip ./win64_0/* || failed "Error zipping SDK"
zip -r ../mac64_0.zip ./mac64_0/* || failed "Error zipping SDK"
zip -r ../linux_0.zip ./linux_0/* || failed "Error zipping SDK"

0 comments on commit 44438a3

Please sign in to comment.