Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to CMake + Introduction of CPack based packages #346

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
13dc8dd
Include CMake config to make lib3mf into a valid CMake package and ch…
vijaiaeroastro Feb 9, 2024
b75f5ec
Update gitignore
vijaiaeroastro Feb 9, 2024
397d572
Comment out unnecessary workflows for easier debugging
vijaiaeroastro Feb 9, 2024
931ad81
.
vijaiaeroastro Feb 9, 2024
7034f68
Disable memtest workflow too. Its expensive
vijaiaeroastro Feb 9, 2024
181d62b
Include CPack generation for all 3 platforms
vijaiaeroastro Feb 9, 2024
13ae405
Included CPack artifact archiving for all 3 platforms (First version)
vijaiaeroastro Feb 9, 2024
0e0fad5
Fix erroneous paths in windows and osx. Linux works (but double zippi…
vijaiaeroastro Feb 9, 2024
9465875
Update dll path in CMake script
vijaiaeroastro Feb 12, 2024
e9aa144
Include Debian and RPM build too (Testing)
vijaiaeroastro Feb 12, 2024
5b9477b
Install RPM build
vijaiaeroastro Feb 12, 2024
a4dbd99
Make a variable called CDYNAMIC_SOURCE available for the CDynamic var…
vijaiaeroastro Feb 19, 2024
a34e7ec
Make changes to make LIB3MF_LIBRARY_LOCATION available to source file…
vijaiaeroastro Feb 19, 2024
caf9207
Check if artifact is single or double zipped
vijaiaeroastro Feb 19, 2024
be09ed2
Test SDK generation again
vijaiaeroastro Feb 19, 2024
372804d
Testing sdk generation
vijaiaeroastro Feb 19, 2024
ff7256b
Inclue cpacked artifacts to assemble SDK
vijaiaeroastro Feb 20, 2024
a461025
Make necessary changes to ensure that linking does not happen in CDyn…
vijaiaeroastro Feb 20, 2024
3ded78b
First steps toward testing cpacked SDK's
vijaiaeroastro Feb 20, 2024
65f213d
Including Linux CppDynamic + Cpacked Cmake build
vijaiaeroastro Feb 20, 2024
9625d60
Include DL also to CppDynamic linking
vijaiaeroastro Feb 20, 2024
55bab75
Include Cpp variant example for Cpacked Linux package
vijaiaeroastro Feb 20, 2024
af3745b
Cpp failure is due to a lower CMake version. First version of routine…
vijaiaeroastro Feb 20, 2024
a955a12
Remove erroneous ls command from windows deployment
vijaiaeroastro Feb 20, 2024
2cc3470
First tests for debian package
vijaiaeroastro Feb 20, 2024
0267604
Include examples for debian package too
vijaiaeroastro Feb 20, 2024
7b2a70f
Check the path once for debian
vijaiaeroastro Feb 20, 2024
660dfd2
Check if debian is being double zipped
vijaiaeroastro Feb 20, 2024
f8f66f7
.
vijaiaeroastro Feb 20, 2024
9d8eb4f
Check the type of debian archive
vijaiaeroastro Feb 20, 2024
62680b0
.
vijaiaeroastro Feb 20, 2024
1be809f
Debian tests should go through
vijaiaeroastro Feb 20, 2024
30f7430
Include architecture to debian package
vijaiaeroastro Feb 20, 2024
24a034b
Calling find_package twice is problematic. So we fix the issue
vijaiaeroastro Feb 20, 2024
e9a3209
Fix a minor mistake in Examples
vijaiaeroastro Feb 20, 2024
dffabe7
Re-enable all blocks of the pipeline. Maintainer email has not been c…
vijaiaeroastro Feb 20, 2024
c967681
Update maintainer email
vijaiaeroastro Feb 26, 2024
0b212ba
A preliminary addition to config.cmake to copy libraries. The functio…
vijaiaeroastro Feb 26, 2024
0331062
Update CMake to remove global warning flags
vijaiaeroastro Mar 26, 2024
5be552e
Dynamically choose the library directory based on the type of tool chain
vijaiaeroastro Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 185 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
on: [push, pull_request]
env:
LIB3MF_VERSION: "2.3.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the version to 2.3.1

name: Build
jobs:

build-linux-memtest:
runs-on: ubuntu-20.04
steps:
Expand All @@ -23,41 +26,65 @@ jobs:
submodules: true
- run: mkdir -p build
- run: zip -r build/bindings.zip Autogenerated/Bindings

- name: Archive bindings
uses: actions/upload-artifact@v2
with:
name: bindings.zip
path: build/bindings.zip
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Docker Build
- name: Docker Build
uses: docker/build-push-action@v5
with:
context: .
file: ./CI/Dockerfile
platforms: linux/amd64
tags: lib3mf_ubi8:latest
load: true
-
name: Docker Extract
- name: Docker Extract
uses: shrink/[email protected]
id: extract
with:
image: lib3mf_ubi8:latest
path: out.zip
destination: dist

- run: unzip out.zip
working-directory: ./dist
-
name: Upload Artifact
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: lib3mf.so
path: dist/lib3mf.so.2
path: dist/lib3mf.so.2
- name: Extract File Name (CPacked Archive)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Archive still necessary ?

run: |
ZIP_FILE=$(ls dist/lib3mf-*.zip)
echo "ARTIFACT_NAME_ZIP=$(basename ${ZIP_FILE})" >> $GITHUB_ENV
shell: bash
- name: Upload Artifact (CPacked Archive)
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME_ZIP }}
path: dist/${{ env.ARTIFACT_NAME_ZIP }}
- name: Extract File Name (Debian)
run: |
DEB_FILE=$(ls dist/lib3mf-*.deb)
echo "ARTIFACT_NAME_DEB=$(basename ${DEB_FILE})" >> $GITHUB_ENV
shell: bash
- name: Upload Artifact (Debian Archive)
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME_DEB }}
path: dist/${{ env.ARTIFACT_NAME_DEB }}
- name: Extract File Name (RPM)
run: |
RPM_FILE=$(ls dist/lib3mf-*.rpm)
echo "ARTIFACT_NAME_RPM=$(basename ${RPM_FILE})" >> $GITHUB_ENV
shell: bash
- name: Upload Artifact (RPM Archive)
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME_RPM }}
path: dist/${{ env.ARTIFACT_NAME_RPM }}

build-macos:
runs-on: macos-latest
Expand All @@ -70,11 +97,24 @@ jobs:
working-directory: ./build
- run: ctest -V
working-directory: ./build
- run: cpack -G ZIP -C Release
working-directory: ./build
- name: Extract File Name
run: |
ZIP_FILE=$(ls build/lib3mf-*.zip)
echo "ARTIFACT_NAME=$(basename ${ZIP_FILE})" >> $GITHUB_ENV
shell: bash
- name: Archive Mac binary
uses: actions/upload-artifact@v2
with:
name: lib3mf.dylib
path: build/lib3mf.dylib
- name: Upload Artifact (CPacked Archive)
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/${{ env.ARTIFACT_NAME }}

codecoverage-macos:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -113,6 +153,13 @@ jobs:
working-directory: ./build
- run: ctest -V
working-directory: ./build
- run: cpack -G ZIP -C Release
working-directory: ./build
- name: Extract File Name
run: |
$zipFile = Get-ChildItem build\lib3mf-*.zip -Name
echo "ARTIFACT_NAME=$zipFile" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Archive Windows Release binary
uses: actions/upload-artifact@v2
with:
Expand All @@ -123,6 +170,12 @@ jobs:
with:
name: lib3mf.lib
path: build/Release/lib3mf.lib
- name: Upload Artifact (CPacked Archive)
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/${{ env.ARTIFACT_NAME }}

build-windows-debug:
runs-on: windows-2019
steps:
Expand Down Expand Up @@ -172,6 +225,8 @@ jobs:
working-directory: ./build
- run: ctest -V
working-directory: ./build


assemble-sdk:
runs-on: ubuntu-20.04
needs: [build-windows-release, build-macos, build-linux-ubi8-gcc12]
Expand All @@ -189,16 +244,43 @@ jobs:
- run: unzip bindings.zip/bindings.zip
working-directory: ./build
- run: bash SDK/GenerateSDK_github.sh
- name: Archive SDK artifact
- name: Archive SDK artifact (Comprehensive)
uses: actions/upload-artifact@v2
with:
name: lib3mf_sdk.zip
path: build/lib3mf_sdk.zip
- name: Archive SDK artifact (CPack - Linux)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
- name: Archive SDK artifact (CPack - Windows)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Archive SDK artifact (CPack - Darwin)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- name: Archive SDK artifact (CPack - Debian)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Archive SDK artifact (CPack - RPM)
uses: actions/upload-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm


deploy-linux:
runs-on: ubuntu-20.04
needs: [assemble-sdk]
steps:
- run: sudo apt install -y zip unzip
- run: sudo apt install -y zip unzip file
- run: pwd
- run: ls -Rl .
- name: Download lib3mf_sdk artifact
Expand All @@ -222,6 +304,54 @@ jobs:
cd Examples/Cpp/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Download lib3mf cpack (Linux)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
- run: ls -Rl .
- name: Unpack the cpacked SDK
run: |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip
- name: Build CppDynamicNew
run: |
sh Examples/CppDynamicNew/GenerateMake.sh
cd Examples/CppDynamicNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Build CppNew
run: |
sh Examples/CppNew/GenerateMake.sh
cd Examples/CppNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Download lib3mf (Debian Linux)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Check the file type
run: |
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- run: pwd
- run: ls -Rl .
- name: Install the debian package
run: |
sudo dpkg -i lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb
- name: Build CppDynamicNew (Debian)
run: |
sh Examples/CppDynamicNew/GenerateMake.sh
cd Examples/CppDynamicNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Build CppNew (Debian)
run: |
sh Examples/CppNew/GenerateMake.sh
cd Examples/CppNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf

deploy-windows:
runs-on: windows-2019
needs: [assemble-sdk]
Expand All @@ -246,6 +376,27 @@ jobs:
cd Examples/Cpp/build
cmake --build . --config Release
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf
- name: Download lib3mf cpack (Windows)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Unpack the cpacked SDK
run: |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip
- name: Build CppDynamic (Windows)
run: |
./Examples/CppDynamic/GenerateVS2019.bat
cd Examples/CppDynamic/build
cmake --build . --config Release
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf
- name: Build Cpp (Windows)
run: |
./Examples/Cpp/GenerateVS2019.bat
cd Examples/Cpp/build
cmake --build . --config Release
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf

deploy-macos:
runs-on: macos-latest
needs: [assemble-sdk]
Expand All @@ -269,4 +420,25 @@ jobs:
sh Examples/Cpp/GenerateMake.sh
cd Examples/Cpp/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Download lib3mf cpack (Darwin)
uses: actions/download-artifact@v2
with:
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
path: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- run: ls -Rl .
- name: Unpack the cpacked SDK (Darwin)
run: |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip
- name: Build CppDynamicNew (Darwin)
run: |
sh Examples/CppDynamicNew/GenerateMake.sh
cd Examples/CppDynamicNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
- name: Build CppNew (Darwin)
run: |
sh Examples/CppNew/GenerateMake.sh
cd Examples/CppNew/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Include/Model/COM/NMR_COMVersion.h
debug
.DS_Store
.vscode
.idea
cmake-build-*
17 changes: 16 additions & 1 deletion CI/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN \
tar \
gzip \
zip \
rpm-build \
${GCCTOOLSET} \
&& microdnf clean all

Expand Down Expand Up @@ -53,14 +54,28 @@ RUN cmake --build .

RUN ctest -V .

# Add this line to generate a ZIP package with cpack
RUN cpack -G ZIP -C Release

# Generate a debian package
RUN cpack -G DEB -C Release

# Generate a RPM package
RUN cpack -G RPM -C Release

WORKDIR "/../../"

RUN mkdir -p out

RUN cp ./lib3mf-repo/build/lib3mf.so.2 ./out/

RUN cd out && zip -r ../out.zip .
RUN cp ./lib3mf-repo/build/lib3mf-*-Linux.zip ./out/

RUN cp ./lib3mf-repo/build/lib3mf-*-Linux.deb ./out/

RUN cp ./lib3mf-repo/build/lib3mf-*-Linux.rpm ./out/

RUN cd out && zip -r ../out.zip .



Expand Down
Loading
Loading