Skip to content
Snippets Groups Projects
Commit b6ead5ad authored by tobiglaser's avatar tobiglaser
Browse files

added Fedora & Ubuntu CI

parent bbc49746
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,74 @@ stages: ...@@ -2,6 +2,74 @@ stages:
- build - build
- release - release
Fedora:
stage: build
image: fedora:latest
only:
- tags
tags: [linux, fedora]
script:
# Build Environment
- sudo dnf check-upgrade && sudo dnf upgrade -y
- sudo dnf install -y cmake gcc gcc-c++
- sudo dnf install -y qt6-qtbase-devel qt6-qtcharts-devel
# Compile
- mkdir build -p && cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++
- cmake --build . --target cute
- ls -lh
- cd ..
# Collect all Files and zip them
- mkdir -p template/{lib,src,.vscode}
- mv build/libcute.so template/lib/
- mv include/cute.h template/lib/
- mv include/dllDefines.h template/lib/
- mv src/main.cpp template/lib/
- mv examples/CMakeLists.txt template/
- mv examples/example.cpp template/
- mv .clang-format template/
- mv .gitignore template/
- mv .vscode/extensions.json template/.vscode/
- zip -r template-fedora.zip template/
# Upload the zip to the Package Registry
- $URL = "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-fedora.zip"
- curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file template-fedora.zip "$URL"
Ubuntu:
stage: build
image: ubuntu:latest
only:
- tags
tags: [linux, ubuntu]
script:
# Build Environment
- sudo apt update && sudo apt upgrade -y
- sudo apt install -y cmake build-essential
- sudo apt install -y qt6-base-dev qt6-charts-dev
# Compile
- mkdir build -p && cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++
- cmake --build . --target cute
- ls -lh
- cd ..
# Collect all Files and zip them
- mkdir -p template/{lib,src,.vscode}
- mv build/libcute.so template/lib/
- mv include/cute.h template/lib/
- mv include/dllDefines.h template/lib/
- mv src/main.cpp template/lib/
- mv examples/CMakeLists.txt template/
- mv examples/example.cpp template/
- mv .clang-format template/
- mv .gitignore template/
- mv .vscode/extensions.json template/.vscode/
- zip -r template-ubuntu.zip template/
# Upload the zip to the Package Registry
- $URL = "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-ubuntu.zip"
- curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file template-ubuntu.zip "$URL"
# see https://www.msys2.org/docs/ci/#gitlab # see https://www.msys2.org/docs/ci/#gitlab
Windows-MSYS2-MINGW64: Windows-MSYS2-MINGW64:
stage: build stage: build
...@@ -56,7 +124,7 @@ Windows-MSYS2-MINGW64: ...@@ -56,7 +124,7 @@ Windows-MSYS2-MINGW64:
mv include/cute.h template/lib/ mv include/cute.h template/lib/
mv include/dllDefines.h template/lib/ mv include/dllDefines.h template/lib/
mv src/main.cpp template/lib/ mv src/main.cpp template/lib/
mv examples/CmakeLists.txt template/ mv examples/CMakeLists.txt template/
mv examples/example.cpp template/ mv examples/example.cpp template/
mv .clang-format template/ mv .clang-format template/
mv .gitignore template/ mv .gitignore template/
...@@ -82,7 +150,7 @@ Publish: ...@@ -82,7 +150,7 @@ Publish:
release: release:
name: "Release $CI_COMMIT_TAG" name: "Release $CI_COMMIT_TAG"
tag_name: "$CI_COMMIT_TAG" tag_name: "$CI_COMMIT_TAG"
description: "Automated release including Windows builds and Doxygen documentation." # & Linux description: "Automated release including Windows and Linux builds as well as Doxygen documentation."
assets: assets:
links: links:
- name: "Windows Template" - name: "Windows Template"
...@@ -91,6 +159,9 @@ Publish: ...@@ -91,6 +159,9 @@ Publish:
- name: "Doxygen" - name: "Doxygen"
link_type: other link_type: other
url: "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/doxygen.zip" url: "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/doxygen.zip"
#- name: "Linux Template" - name: "Fedora Template"
# link_type: package link_type: package
# url: "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-linux.zip" url: "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-fedora.zip"
- name: "Ubuntu Template"
link_type: package
url: "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-ubuntu.zip"
...@@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 17) ...@@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(MY_TARGET "cybersolution") set(MY_TARGET "cybersolution") # <-- Name of the executable
if(WIN32) if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ${CMAKE_FIND_LIBRARY_SUFFIXES})
...@@ -42,7 +42,14 @@ if(WIN32) ...@@ -42,7 +42,14 @@ if(WIN32)
endif(WIN32) endif(WIN32)
# Use this command to copy the .dll from the lib folder next to the freshly built .exe. Which is the most simple way to get it working. # Use this command to copy the .dll from the lib folder next to the freshly built .exe. Which is the most simple way to get it working.
if(WIN32)
add_custom_command(TARGET ${MY_TARGET} POST_BUILD # Adds a post-build event to DynamicDemo add_custom_command(TARGET ${MY_TARGET} POST_BUILD # Adds a post-build event to DynamicDemo
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..." COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/lib/cute.dll" # <--this is in-file "${PROJECT_SOURCE_DIR}/lib/cute.dll" # <--this is in-file
$<TARGET_FILE_DIR:${MY_TARGET}>) # <--this is out-file path $<TARGET_FILE_DIR:${MY_TARGET}>) # <--this is out-file path
else()
add_custom_command(TARGET ${MY_TARGET} POST_BUILD # Adds a post-build event to DynamicDemo
COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
"${PROJECT_SOURCE_DIR}/lib/libcute.so" # <--this is in-file
$<TARGET_FILE_DIR:${MY_TARGET}>) # <--this is out-file path
endif(WIN32)
\ No newline at end of file
#include "cute.h"
void my_func();
void setup()
{
cute::registerAlgorithm(my_func, "MY FUNCTION");
}
void my_func()
{
cute::setStatusMessage("Hello World!", 2);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment