This commit is contained in:
恍兮惚兮 2024-04-28 00:50:54 +08:00
parent 6a06a60f21
commit 3c121a1b9d
2 changed files with 33 additions and 8 deletions

View File

@ -39,6 +39,10 @@ jobs:
with:
name: ${{ matrix.fname }}
path: build/${{ matrix.fname }}.zip
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.fname }} sfx
path: build/${{ matrix.fname }}.exe
- name: loadversion
id: loadversion
@ -47,6 +51,8 @@ jobs:
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.loadversion.outputs.version }}
files: build/${{ matrix.fname }}.zip
files: |
build/${{ matrix.fname }}.zip
build/${{ matrix.fname }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -8,23 +8,22 @@ if x86:
targetdir=r'..\build\LunaTranslator_x86'
launch=r'..\plugins\builds\_x86'
downlevel=r'C:\Windows\SysWOW64\downlevel'
target='LunaTranslator_x86.zip'
target='LunaTranslator_x86'
baddll='DLL64'
else:
baddll='DLL32'
target='LunaTranslator.zip'
target='LunaTranslator'
launch=r'..\plugins\builds\_x64'
nuitkadist=r'..\build\x64\LunaTranslator_main.dist'
targetdir=r'..\build\LunaTranslator'
downlevel=r'C:\Windows\system32\downlevel'
if isdebug:
targetdir+=r'_debug'
target+='_debug'
if x86:
nuitkadist=r'..\build\x86_debug\LunaTranslator_main.dist'
target='LunaTranslator_x86_debug.zip'
else:
nuitkadist=r'..\build\x64_debug\LunaTranslator_main.dist'
target='LunaTranslator_debug.zip'
targetdir_in=rf'{targetdir}\LunaTranslator'
@ -107,6 +106,26 @@ for f in collect:
with open(f,'wb') as ff:
ff.write(bs)
if os.path.exists(rf'{targetdir}\..\{target}'):
os.remove(rf'{targetdir}\..\{target}')
os.system(rf'"C:\Program Files\7-Zip\7z.exe" a -m0=LZMA -mx9 {targetdir}\..\{target} {targetdir}')
if os.path.exists(rf'{targetdir}\..\{target}.zip'):
os.remove(rf'{targetdir}\..\{target}.zip')
if os.path.exists(rf'{targetdir}\..\{target}.7z'):
os.remove(rf'{targetdir}\..\{target}.7z')
os.system(rf'"C:\Program Files\7-Zip\7z.exe" a -m0=LZMA -mx9 {targetdir}\..\{target}.zip {targetdir}')
os.system(rf'"C:\Program Files\7-Zip\7z.exe" a -m0=LZMA2 -mx9 {targetdir}\..\{target}.7z {targetdir}')
with open(r'C:\Program Files\7-Zip\7z.sfx','rb') as ff:
sfx=ff.read()
config='''
;!@Install@!UTF-8!
;!@InstallEnd@!
'''
with open(rf'{targetdir}\..\{target}.7z','rb') as ff:
data=ff.read()
with open(rf'{targetdir}\..\{target}.exe','wb') as ff:
ff.write(sfx)
ff.write(config.encode('utf8'))
ff.write(data)