From 44438a3e757f943fe7270c1fd29c3c023216a605 Mon Sep 17 00:00:00 2001 From: gangatp Date: Wed, 21 Feb 2024 10:22:24 +0530 Subject: [PATCH] creating fusion3p --- .github/workflows/build.yml | 15 +++++++- Fusion/Generate3P.sh | 69 +++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 Fusion/Generate3P.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2260343e7..41968da7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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] diff --git a/Fusion/Generate3P.sh b/Fusion/Generate3P.sh new file mode 100644 index 000000000..3d9d416fa --- /dev/null +++ b/Fusion/Generate3P.sh @@ -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"