Add GitHub Actions CI/CD (#23)

* Create linux.yml

* Create windows.yml

* re-enable static builds
make a better linux github workflow

* better windows action script
fix linux output zip

* fix path typos

* Update readme

---------

Co-authored-by: Neo <321592+Neo-Desktop@users.noreply.github.com>
This commit is contained in:
TheTank20
2023-06-16 07:57:56 -05:00
committed by GitHub
parent 62ab8caf87
commit 40c60e656f
4 changed files with 121 additions and 14 deletions

View File

@@ -2,12 +2,18 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
PROJECT(WindowsXPKg)
SET(CMAKE_CXX_STANDARD 17)
# TODO: commenting out static builds for now
#SET(OPENSSL_USE_STATIC_LIBS TRUE)
SET(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")
SET(OPENSSL_USE_STATIC_LIBS TRUE)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_PACKAGE(OpenSSL REQUIRED)
IF(!OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "OpenSSL Development Libraries Not Found")
MESSAGE(SEND_ERROR "OpenSSL Development Libraries Not Found")
MESSAGE(SEND_ERROR "Please consult your package manager of choice to install the prerequisite")
MESSAGE(SEND_ERROR "The package name is commonly called libssl-dev or openssl-dev depending on distribution")
MESSAGE(FATAL_ERROR "Can not continue without OpenSSL")
ENDIF()
INCLUDE(cmake/CPM.cmake)
@@ -23,8 +29,18 @@ CPMAddPackage("gh:fmtlib/fmt#7.1.3")
CONFIGURE_FILE(keys.json keys.json COPYONLY)
#SET(BUILD_SHARED_LIBS OFF)
#SET(CMAKE_EXE_LINKER_FLAGS "-static")
ADD_EXECUTABLE(xpkey src/main.cpp src/BINK2002.cpp src/BINK1998.cpp src/key.cpp src/util.cpp src/cli.cpp src/confid.cpp)
ADD_LIBRARY(BINK1998 STATIC src/BINK1998.cpp)
TARGET_INCLUDE_DIRECTORIES(BINK1998 PUBLIC crypto)
TARGET_LINK_LIBRARIES(BINK1998 OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_LIBRARY(BINK2002 STATIC src/BINK2002.cpp)
TARGET_INCLUDE_DIRECTORIES(BINK2002 PUBLIC crypto)
TARGET_LINK_LIBRARIES(BINK2002 OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_LIBRARY(CONFID STATIC src/confid.cpp)
TARGET_INCLUDE_DIRECTORIES(CONFID PUBLIC crypto)
TARGET_LINK_LIBRARIES(CONFID OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
ADD_EXECUTABLE(xpkey src/main.cpp src/key.cpp src/util.cpp src/cli.cpp)
TARGET_INCLUDE_DIRECTORIES(xpkey PUBLIC crypto)
TARGET_LINK_LIBRARIES(xpkey PUBLIC OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)
TARGET_LINK_LIBRARIES(xpkey BINK1998 BINK2002 CONFID OpenSSL::Crypto nlohmann_json::nlohmann_json fmt)