File tree 3 files changed +50
-21
lines changed
3 files changed +50
-21
lines changed Original file line number Diff line number Diff line change @@ -49,20 +49,18 @@ jobs:
49
49
run : |
50
50
mkdir ccccc
51
51
cp bin/gmake2/Release/ccccc.exe ccccc/
52
- cp /D/a/_temp/msys64/mingw64/bin/libffi-*.dll ccccc/
53
- cp /D/a/_temp/msys64/mingw64/bin/libgcc_s_seh-*.dll ccccc/
54
- cp /D/a/_temp/msys64/mingw64/bin/libiconv-*.dll ccccc/
55
- cp /D/a/_temp/msys64/mingw64/bin/libLLVM-*.dll ccccc/
56
- cp /D/a/_temp/msys64/mingw64/bin/liblzma-*.dll ccccc/
57
- cp /D/a/_temp/msys64/mingw64/bin/libstdc++-*.dll ccccc/
58
- cp /D/a/_temp/msys64/mingw64/bin/libwin*thread-*.dll ccccc/
59
- cp /D/a/_temp/msys64/mingw64/bin/libxml2-*.dll ccccc/
60
- cp /D/a/_temp/msys64/mingw64/bin/libzstd.dll ccccc/
61
- cp /D/a/_temp/msys64/mingw64/bin/zlib1.dll ccccc/
52
+ python mingw_deploy.py ccccc/ccccc.exe
62
53
63
54
- name : Upload ccccc
64
55
uses : actions/upload-artifact@v4
65
56
with :
66
57
name : ccccc
67
58
path : |
68
- ccccc/*.*
59
+ ccccc/*.exe
60
+
61
+ - name : Upload ccccc dependencies
62
+ uses : actions/upload-artifact@v4
63
+ with :
64
+ name : ccccc_dll
65
+ path : |
66
+ ccccc/*.dll
Original file line number Diff line number Diff line change 47
47
run : |
48
48
mkdir ccccc
49
49
cp bin/gmake2/Release/ccccc.exe ./
50
- cp /D/a/_temp/msys64/mingw64/bin/libffi-*.dll ./
51
- cp /D/a/_temp/msys64/mingw64/bin/libgcc_s_seh-*.dll ./
52
- cp /D/a/_temp/msys64/mingw64/bin/libiconv-*.dll ./
53
- cp /D/a/_temp/msys64/mingw64/bin/libLLVM-*.dll ./
54
- cp /D/a/_temp/msys64/mingw64/bin/liblzma-*.dll ./
55
- cp /D/a/_temp/msys64/mingw64/bin/libstdc++-*.dll ./
56
- cp /D/a/_temp/msys64/mingw64/bin/libwin*thread-*.dll ./
57
- cp /D/a/_temp/msys64/mingw64/bin/libxml2-*.dll ./
58
- cp /D/a/_temp/msys64/mingw64/bin/libzstd.dll ./
59
- cp /D/a/_temp/msys64/mingw64/bin/zlib1.dll ./
50
+ python mingw_deploy.py ccccc.exe
60
51
61
52
- name : Upload ccccc
62
53
uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change
1
+ import ntpath
2
+ import os
3
+ import shutil
4
+ import subprocess
5
+ import sys
6
+
7
+ def usage ():
8
+ print ('mingw_deploy application [target-directory]' )
9
+ print ()
10
+ print ('copy dependent mingw dlls needed by application in target-directory (default to near the application)' )
11
+ sys .exit (- 1 )
12
+
13
+ # main
14
+ if __name__ == "__main__" :
15
+ if len (sys .argv ) < 2 or len (sys .argv ) > 3 :
16
+ print ('invalid argument' )
17
+ usage ()
18
+ application = sys .argv [1 ]
19
+ target_directory = len (sys .argv ) > 2 and sys .argv [2 ] or os .path .dirname (application )
20
+ if not os .path .exists (application ):
21
+ print (application , "not found" )
22
+ exit (- 1 )
23
+
24
+ # Retrieve dependencies from mingw
25
+ # so the ones from $(InstallPath)\msys64\mingw32\bin\$(dependencies.dll)
26
+ ret = subprocess .run (['cygcheck' , application ], capture_output = True )
27
+ dlls = [
28
+ line .strip () for line in ret .stdout .decode ().split ('\n ' )
29
+ if line .find ('clang32' ) != - 1
30
+ or line .find ('clang64' ) != - 1
31
+ or line .find ('mingw32' ) != - 1
32
+ or line .find ('mingw64' ) != - 1
33
+ or line .find ('ucrt64' ) != - 1
34
+ ]
35
+ # copy dlls in target-directory
36
+ if len (dlls ) > 0 :
37
+ print ("copy in" , target_directory )
38
+ for file in dlls :
39
+ shutil .copyfile (ntpath .abspath (file ), target_directory + '/' + ntpath .basename (file ))
40
+ print (file , "copied" )
You can’t perform that action at this time.
0 commit comments