File tree 4 files changed +52
-4
lines changed
4 files changed +52
-4
lines changed Original file line number Diff line number Diff line change 22
22
PKGNAME="capstone-$VERSION"
23
23
SHASUM=$PKGNAME.tar.xz.sha256
24
24
mkdir -p /tmp/$PKGNAME
25
- mv * /tmp/$PKGNAME
26
- mv /tmp/$PKGNAME .
25
+ rsync -a --exclude=build --exclude='.*' ./ /tmp/$PKGNAME/
27
26
TARBALL=$PKGNAME.tar.xz
28
- tar cJf $TARBALL $PKGNAME
27
+ tar -C /tmp - cJf $TARBALL $PKGNAME
29
28
sha256sum $TARBALL > $SHASUM
30
29
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
31
30
echo "shasum=$SHASUM" >> $GITHUB_OUTPUT
64
63
files : |
65
64
./build/*.deb
66
65
./build/*.rpm
66
+
67
+ build_windows :
68
+ name : build_windows
69
+ runs-on : windows-latest
70
+ steps :
71
+ - uses : actions/checkout@v4
72
+ with :
73
+ submodules : true
74
+
75
+ - name : Win MSVC 64 dev cmd setup
76
+ uses : ilammy/msvc-dev-cmd@v1
77
+ with :
78
+ arch : x64
79
+
80
+ - name : Configure CMake and build the project
81
+ run : |
82
+ cmake -B build `
83
+ -T "ClangCL,host=x64" `
84
+ -A x64 `
85
+ -DPROJECT_VERSION="${{ github.event.release.tag_name }}" `
86
+ -DCMAKE_BUILD_TYPE=Release `
87
+ -DCAPSTONE_BUILD_SHARED_LIBS=1
88
+ cmake --build build --config Release
89
+ cmake --install build --config Release
90
+
91
+ - name : Package NSIS installer
92
+ run : |
93
+ cd build
94
+ cpack -G NSIS
95
+
96
+ - name : Upload NSIS installer to release
97
+ uses : softprops/action-gh-release@v2
98
+ env :
99
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100
+ with :
101
+ tag_name : ${{ github.event.release.tag_name }}
102
+ files : |
103
+ ./build/*.exe
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ endif()
20
20
cmake_policy (SET CMP0042 NEW)
21
21
22
22
# Check if VERSION is provided externally, otherwise default to 6.0.0
23
- if (NOT DEFINED PROJECT_VERSION)
23
+ if (NOT DEFINED PROJECT_VERSION OR PROJECT_VERSION STREQUAL "" )
24
24
set (PROJECT_VERSION "6.0.0" )
25
25
endif ()
26
26
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ foreach(generator ${CPACK_GENERATOR})
4
4
set (CPACK_PACKAGE_FILE_NAME ${CPACK_DEBIAN_PACKAGE_FILE_NAME} )
5
5
elseif ("${generator} " STREQUAL "RPM" )
6
6
set (CPACK_PACKAGE_FILE_NAME ${CPACK_RPM_PACKAGE_FILE_NAME} )
7
+ elseif ("${generator} " STREQUAL "NSIS" )
8
+ set (CPACK_PACKAGE_FILE_NAME ${CPACK_NSIS_PACKAGE_FILE_NAME} )
7
9
elseif ("${generator} " STREQUAL "DragNDrop" )
8
10
set (CPACK_PACKAGE_FILE_NAME ${CPACK_DMG_PACKAGE_FILE_NAME} )
9
11
else ()
Original file line number Diff line number Diff line change @@ -51,9 +51,18 @@ set(CPACK_RPM_CHANGELOG_FILE "${PROJECT_SOURCE_DIR}/ChangeLog")
51
51
set(CPACK_RPM_PACKAGE_LICENSE "BSD3, LLVM")
52
52
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
53
53
54
+ # Windows package settings
55
+ if(WIN32)
56
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "capstone")
57
+ set(CPACK_SYSTEM_NAME "Windows-x64")
58
+ set(CPACK_NSIS_MODIFY_PATH ON)
59
+ set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
60
+ endif()
61
+
54
62
# Set package file name based on the generator
55
63
set(CPACK_DEBIAN_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
56
64
set(CPACK_RPM_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
57
65
set(CPACK_DMG_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
66
+ set(CPACK_NSIS_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
58
67
59
68
include(CPack)
You can’t perform that action at this time.
0 commit comments