Skip to content

Commit

Permalink
adding in attempt to create windows release
Browse files Browse the repository at this point in the history
  • Loading branch information
RCMast3r committed Dec 23, 2023
1 parent 8d7f1a4 commit f1c49af
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/create_releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches:
- main # Adjust branch name as needed

jobs:
build:
runs-on: windows-latest # Choose the appropriate OS for your project

steps:
- uses: actions/checkout@v2 # Check out your repository

- name: Set up CMake
uses: cmake-actions/setup-cmake@v1
with:
cmake-version: '3.21' # Adjust version as needed

- name: Build and Package
run: |
cd third-party
mkdir build
cd build
cmake ..
cmake --build . --target package # Generate installer
# Add commands to upload the installer artifact (e.g., using GitHub Actions' upload-artifact)
9 changes: 9 additions & 0 deletions generator/install-dbcppp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# git clone --recurse-submodules https://github.com/xR3b0rn/dbcppp.git
cd dbcppp
# mkdir build
cd build

cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
make RunTests
20 changes: 19 additions & 1 deletion generator/pio_lib_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@
generated_src_dir = os.path.join(build_dir, 'dbcppp', 'generated-src')
generated_build_dir = os.path.join(build_dir, 'dbcppp', 'generated-build')

def install_dbcppp():
try:
print(subprocess.Popen(["./install-dbcppp.sh"], stdout=subprocess.PIPE))
except OSError as error:
print("ERROR occured while trying to install dep")
try:
subprocess.Popen(["cmake"], stdout = subprocess.PIPE)
print("you have cmake installed")
except OSError as error:
print("ERROR install cmake")

try:
subprocess.Popen([build_dir+"/dbcppp-bin/dbcppp"], stdout = subprocess.PIPE)
except OSError as error:
print("[pio_lib_gen] Installing dependencies");
install_dbcppp()


user_dbc_files = env.subst(env.GetProjectOption("user_dbcs", ""))

dbc_files = fs.match_src_files(project_dir, user_dbc_files)
Expand All @@ -30,4 +48,4 @@
print(f"user_dbcs: {user_dbc_files}")
exit(1)

print("hello from lib")
print("hello from lib2")
35 changes: 35 additions & 0 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

include(ExternalProject)

# Set up an external project to pull source code from Git along with submodules
ExternalProject_Add(
dbcppp# Name for this external project
PREFIX ${CMAKE_BINARY_DIR}/external/dbcppp # Directory where the source will be downloaded
GIT_REPOSITORY https://github.com/xR3b0rn/dbcppp.git # Replace with your Git repository URL
GIT_TAG v3.2.6 # Replace with the branch or tag you want to use
TIMEOUT 10 # Adjust as needed
CONFIGURE_COMMAND "" # No configuration needed
BUILD_COMMAND "" # No build commands needed
INSTALL_COMMAND "" # No installation needed
LOG_DOWNLOAD ON # Enable logging for download details
GIT_SUBMODULES_INIT ON # Fetch submodules
)

# Use the downloaded project as part of your build
ExternalProject_Get_Property(dbcppp source_dir)
add_subdirectory(${source_dir} ${CMAKE_BINARY_DIR}/external/dbcppp-build)

# Enable CPack module
include(CPack)

# Set the basic CPack settings
set(CPACK_GENERATOR "NSIS") # Use NSIS installer (you can use other generators as needed)
set(CPACK_PACKAGE_NAME "dbcppp")
set(CPACK_PACKAGE_VERSION "3.2.6")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")

# Specify files to be installed (your executable and any other necessary files)
install(TARGETS dbcppp DESTINATION bin) # Replace YourExecutable with your actual target name

# Other installation instructions for additional files, if any

0 comments on commit f1c49af

Please sign in to comment.