diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index ba465d1..e61c1f0 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -13,10 +13,12 @@ jobs: build_platform: [x64, ARM64, Win32] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: generate cmake run: | + # avoid issue for x64 build to find false openssl by libssh + Remove-Item -Recurse -Force 'C:\Program Files\OpenSSL' mkdir _build cd _build cmake -G "Visual Studio 17 2022" -A ${{ matrix.build_platform }} -T "v143" .. @@ -24,38 +26,61 @@ jobs: - name: build cmake run: | cd _build - cmake --build . --config ${{ matrix.build_configuration }} + cmake --build . --config ${{ matrix.build_configuration }} --target package - name: Archive artifacts for x64 if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: plugin_dll_x64 path: _build\${{ matrix.build_configuration }}\NppFTP.dll + - name: Archive artifacts for x64 CPack + if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v4 + with: + name: cpack_plugin_dll_x64 + path: _build\NppFTP-0.29.13-win64.zip + - name: Archive artifacts for ARM64 if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: plugin_dll_ARM64 path: _build\${{ matrix.build_configuration }}\NppFTP.dll + - name: Archive artifacts for ARM64 CPack + if: matrix.build_platform == 'ARM64' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v4 + with: + name: cpack_plugin_dll_ARM64 + path: _build\NppFTP-0.29.13-win64.zip + - name: Archive artifacts for Win32 if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: plugin_dll_x86 path: _build\${{ matrix.build_configuration }}\NppFTP.dll + - name: Archive artifacts for Win32 CPack + if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v4 + with: + name: cpack_plugin_dll_x86 + path: _build\NppFTP-0.29.13-win32.zip + + build_linux: runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: build_platform: ["64", "32"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages via apt run: | @@ -68,14 +93,14 @@ jobs: - name: Archive artifacts for x86 if: matrix.build_platform == '32' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: NppFTP-x86.zip path: NppFTP-x86.zip - name: Archive artifacts for x64 if: matrix.build_platform == '64' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: NppFTP-x64.zip path: NppFTP-x64.zip @@ -98,12 +123,13 @@ jobs: runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: build_configuration: [Release, Debug] build_platform: ["Unix Makefiles"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages via apt run: | @@ -121,3 +147,10 @@ jobs: run: | cd _build cmake --build . --config ${{ matrix.build_configuration }} --target package + + - name: Archive artifacts for x64 CPack + if: matrix.build_configuration == 'Release' + uses: actions/upload-artifact@v4 + with: + name: cpack_plugin_dll_x64_linux + path: _build/NppFTP-0.29.13-win64.zip diff --git a/CMakeLists.txt b/CMakeLists.txt index 73af267..ff43c87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 3.5) set (CMAKE_SYSTEM_NAME Windows) @@ -142,21 +142,22 @@ if (MINGW) #remove the lib from the generated target lib SET(CMAKE_SHARED_LIBRARY_PREFIX "") - target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto crypt32 z ws2_32) + target_link_libraries (NppFTP comctl32 shlwapi ssh ssl crypto crypt32 z ws2_32 iphlpapi) else (MINGW) - target_link_libraries (NppFTP comctl32 shlwapi ssh libeay32 ssleay32 crypt32 zlib ws2_32) + target_link_libraries (NppFTP comctl32 shlwapi ssh libeay32 ssleay32 crypt32 zlib ws2_32 iphlpapi) endif (MINGW) # build a CPack driven zip package #include (InstallRequiredSystemLibraries) +set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) install(TARGETS NppFTP - DESTINATION ${CMAKE_BINARY_DIR}/zip/bin) + DESTINATION zip) -FILE(GLOB files "${CMAKE_SOURCE_DIR}/doc/*") -INSTALL(FILES ${files} DESTINATION ${CMAKE_BINARY_DIR}/zip/doc) +INSTALL(DIRECTORY docs/ DESTINATION zip/doc) +set(CPACK_PACKAGE_VERSION "0.29.13") set(CPACK_GENERATOR ZIP) INCLUDE(CPack) diff --git a/Makefile.mingw b/Makefile.mingw index bce7770..5922083 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -10,7 +10,7 @@ endif CXX = $(PREFIX)-g++ CFLAGS = -MMD -Os -O3 -Wall -Wno-unused-value -Werror -fexpensive-optimizations -DLIBSSH_STATIC -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lcrypt32 -lz -lgdi32 -lws2_32 +LFLAGS = -static -L$(OUTDIR)/obj -L$(OUTDIR)/3rdparty/lib -lcomdlg32 -lcomctl32 -luuid -lole32 -lshlwapi -lssh -lssl -lcrypto -lcrypt32 -lz -lgdi32 -lws2_32 -liphlpapi INC = -I$(OUTDIR)/3rdparty/include -Isrc -Isrc/Windows -Itinyxml/include -IUTCP/include -I. RES = $(OUTDIR)/obj/NppFTP.res diff --git a/appveyor.yml b/appveyor.yml index 1424b80..1d2b16b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.29.12.{build} +version: 0.29.13.{build} image: Visual Studio 2022 @@ -59,7 +59,7 @@ build_script: if ($LastExitCode -ne 0) { throw "Exec: $ErrorMessage" } - & cmake --build . --config $env:CONFIGURATION -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + & cmake --build . --config $env:CONFIGURATION --target package -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" if ($LastExitCode -ne 0) { throw "Exec: $ErrorMessage" } diff --git a/build_3rdparty.py b/build_3rdparty.py index f778928..46810a6 100755 --- a/build_3rdparty.py +++ b/build_3rdparty.py @@ -73,8 +73,8 @@ 'libssh': { 'order' : 3, 'shadow': True, - 'url' : 'https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.10.5.tar.xz', - 'sha1' : '6c9c51aec473e409cb4086ce77d299f39bc1d533', + 'url' : 'https://www.libssh.org/files/0.10/libssh-0.10.6.tar.xz', + 'sha1' : 'e8fb3b4750db11d2483cac4b5f046e301c09b72f', 'target': { 'mingw-w64': { 'result': ['include/libssh/libssh.h', 'lib/libssh.a'], @@ -136,7 +136,7 @@ def shell(cmd): def rmdir(path): if os.path.exists(path): if platform.system() == 'Windows': - shell('attrib -R %s\* /S' % path) + shell('attrib -R %s\\* /S' % path) shutil.rmtree(path) def mkdir_p(*paths):