Add Github Action for generating release binaries

This commit is contained in:
Tino Reichardt
2023-02-18 12:16:00 +01:00
parent 8b011d230f
commit f0954038bc
6 changed files with 249 additions and 76 deletions

View File

@@ -6,13 +6,12 @@
# 15.0 https://learn.microsoft.com/en-us/visualstudio/releases/2017/vs2017-compatibility-vs # 15.0 https://learn.microsoft.com/en-us/visualstudio/releases/2017/vs2017-compatibility-vs
# 16.0 https://learn.microsoft.com/en-us/visualstudio/releases/2019/compatibility # 16.0 https://learn.microsoft.com/en-us/visualstudio/releases/2019/compatibility
# 17.0 https://learn.microsoft.com/en-us/visualstudio/releases/2022/compatibility # 17.0 https://learn.microsoft.com/en-us/visualstudio/releases/2022/compatibility
# -> take 16.0 for now /TR # -> we take 16.0 for now /TR
######################################################################################## ########################################################################################
name: Build Windows binaries name: Build Windows binaries
on: [push, pull_request] on: [push, pull_request]
# runs-on: windows-latest -> VS 17.0
jobs: jobs:
build: build:
@@ -39,167 +38,150 @@ jobs:
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3 uses: microsoft/setup-msbuild@v1.3
with:
vs-version: 16.11
- name: Enable Developer Command Prompt - name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
- name: Compile ${{ matrix.arch }} - name: Compiling ${{ matrix.arch }}
shell: cmd shell: cmd
run: | run: |
set APPVEYOR_BUILD_FOLDER=%cd% set WDIR=%cd%
set CLOUD=TRUE
set VC=17.0
set PLATFORM=${{matrix.platform}} set PLATFORM=${{matrix.platform}}
set SUBSYS=${{matrix.subsys}} set SUBSYS=${{matrix.subsys}}
set DEBUG=${{ matrix.debug }} set ROOT=%cd%\CPP\7zip
echo "********" set OUTDIR=%WDIR%\build\bin-%PLATFORM%
echo "APPVEYOR_BUILD_FOLDER: %APPVEYOR_BUILD_FOLDER%"
echo "Platform: %PLATFORM%"
echo "SUBSYS: %SUBSYS%"
echo "Build: %DEBUG%"
echo "GithubAction: %CLOUD%"
cd cpp
@echo off
set ROOT=%cd%\7zip
set OUTDIR=%APPVEYOR_BUILD_FOLDER%\build\bin-%VC%-%PLATFORM%
set ERRFILE=%APPVEYOR_BUILD_FOLDER%\build\bin-%VC%-%PLATFORM%.log
set LFLAGS=/SUBSYSTEM:WINDOWS,%SUBSYS% set LFLAGS=/SUBSYSTEM:WINDOWS,%SUBSYS%
set > %APPVEYOR_BUILD_FOLDER%\build\env-%VC%-%PLATFORM%.txt echo "********"
echo "Working Dir: %WDIR%"
echo "Platform: %PLATFORM%"
echo "SUBSYS: %SUBSYS%"
@echo off
set > %WDIR%\build\env-%PLATFORM%.txt
mkdir %OUTDIR% mkdir %OUTDIR%
cd %ROOT%\Bundles\Format7zExtract cd %ROOT%\Bundles\Format7zExtract
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 echo "Error @ 7zxa.dll" >> %ERRFILE% IF %errorlevel% NEQ 0 EXIT 1
copy %PLATFORM%\7zxa.dll %OUTDIR%\7zxa.dll copy %PLATFORM%\7zxa.dll %OUTDIR%\7zxa.dll
cd %ROOT%\Bundles\Format7z cd %ROOT%\Bundles\Format7z
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7za.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7za.dll %OUTDIR%\7za.dll copy %PLATFORM%\7za.dll %OUTDIR%\7za.dll
cd %ROOT%\Bundles\Format7zF cd %ROOT%\Bundles\Format7zF
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7z.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7z.dll %OUTDIR%\7z.dll copy %PLATFORM%\7z.dll %OUTDIR%\7z.dll
cd %ROOT%\UI\FileManager cd %ROOT%\UI\FileManager
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7zFM.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7zFM.exe %OUTDIR%\7zFM.exe copy %PLATFORM%\7zFM.exe %OUTDIR%\7zFM.exe
cd %ROOT%\UI\GUI cd %ROOT%\UI\GUI
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7zG.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7zG.exe %OUTDIR%\7zG.exe copy %PLATFORM%\7zG.exe %OUTDIR%\7zG.exe
cd %ROOT%\UI\Explorer cd %ROOT%\UI\Explorer
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7-zip.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7-zip.dll %OUTDIR%\7-zip.dll copy %PLATFORM%\7-zip.dll %OUTDIR%\7-zip.dll
cd %ROOT%\Bundles\SFXWin cd %ROOT%\Bundles\SFXWin
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7z.sfx" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7z.sfx %OUTDIR%\7z.sfx copy %PLATFORM%\7z.sfx %OUTDIR%\7z.sfx
cd %ROOT%\Bundles\Codec_brotli cd %ROOT%\Bundles\Codec_brotli
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ brotli.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\brotli.dll %OUTDIR%\brotli.dll copy %PLATFORM%\brotli.dll %OUTDIR%\brotli.dll
cd %ROOT%\Bundles\Codec_lizard cd %ROOT%\Bundles\Codec_lizard
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ lizard.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\lizard.dll %OUTDIR%\lizard.dll copy %PLATFORM%\lizard.dll %OUTDIR%\lizard.dll
cd %ROOT%\Bundles\Codec_lz4 cd %ROOT%\Bundles\Codec_lz4
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ lz4.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\lz4.dll %OUTDIR%\lz4.dll copy %PLATFORM%\lz4.dll %OUTDIR%\lz4.dll
cd %ROOT%\Bundles\Codec_lz5 cd %ROOT%\Bundles\Codec_lz5
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ lz5.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\lz5.dll %OUTDIR%\lz5.dll copy %PLATFORM%\lz5.dll %OUTDIR%\lz5.dll
cd %ROOT%\Bundles\Codec_zstd cd %ROOT%\Bundles\Codec_zstd
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ zstd.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\zstd.dll %OUTDIR%\zstd.dll copy %PLATFORM%\zstd.dll %OUTDIR%\zstd.dll
cd %ROOT%\Bundles\Codec_flzma2 cd %ROOT%\Bundles\Codec_flzma2
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ flzma2.dll" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\flzma2.dll %OUTDIR%\flzma2.dll copy %PLATFORM%\flzma2.dll %OUTDIR%\flzma2.dll
cd %ROOT%\..\..\C\Util\7zipInstall cd %ROOT%\..\..\C\Util\7zipInstall
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ Install.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7zipInstall.exe %OUTDIR%\Install.exe copy %PLATFORM%\7zipInstall.exe %OUTDIR%\Install.exe
cd %ROOT%\..\..\C\Util\7zipUninstall cd %ROOT%\..\..\C\Util\7zipUninstall
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ Uninstall.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7zipUninstall.exe %OUTDIR%\Uninstall.exe copy %PLATFORM%\7zipUninstall.exe %OUTDIR%\Uninstall.exe
set LFLAGS=/SUBSYSTEM:CONSOLE,%SUBSYS% set LFLAGS=/SUBSYSTEM:CONSOLE,%SUBSYS%
cd %ROOT%\UI\Console cd %ROOT%\UI\Console
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7z.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7z.exe %OUTDIR%\7z.exe copy %PLATFORM%\7z.exe %OUTDIR%\7z.exe
cd %ROOT%\Bundles\SFXCon cd %ROOT%\Bundles\SFXCon
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7zCon.sfx" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7zCon.sfx %OUTDIR%\7zCon.sfx copy %PLATFORM%\7zCon.sfx %OUTDIR%\7zCon.sfx
cd %ROOT%\Bundles\Alone cd %ROOT%\Bundles\Alone
nmake %OPTS% nmake %OPTS%
IF %errorlevel% NEQ 0 ( IF %errorlevel% NEQ 0 EXIT 1
echo "Error @ 7za.exe" >> %ERRFILE%
exit -1 )
copy %PLATFORM%\7za.exe %OUTDIR%\7za.exe copy %PLATFORM%\7za.exe %OUTDIR%\7za.exe
REM Will be by the do-release action
copy %WDIR%\.github\workflows\do-release.cmd %WDIR%\build\do-release.cmd
- name: Upload a Build Artifact - name: Upload a Build Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
# A file, directory or wildcard pattern that describes what to upload path: ${{ github.workspace }}\build\**\*
path: ${{ github.workspace }}/build/**/*
do-release:
runs-on: windows-2019
needs: build
steps:
- uses: actions/download-artifact@v3
- name: Generate binaries for release
shell: cmd
run: |
cd artifact
do-release.cmd
- uses: geekyeggo/delete-artifact@v2
with:
name: artifact
- uses: actions/upload-artifact@v3
with:
name: 7-Zip ZS Release binaries
path: |
artifact\*.exe
artifact\*.7z

91
.github/workflows/do-release.cmd vendored Normal file
View File

@@ -0,0 +1,91 @@
@echo off
REM Build some release of 7-Zip ZS
SET COPYCMD=/Y /B
SET COPTS=-m0=lzma -mx9 -ms=on -mf=bcj2
SET URL=https://www.7-zip.org/a/7z2201.exe
SET VERSION=22.01
SET SZIP="C:\Program Files\7-Zip\7z.exe"
SET LURL=https://raw.githubusercontent.com/mcmilk/7-Zip-zstd/master/CPP/7zip/Bundles
SET WD=%cd%
SET SKEL=%WD%\skel
REM Download our skeleton files
mkdir %SKEL%
cd %SKEL%
curl %URL% --output 7-Zip.exe
%SZIP% x 7-Zip.exe
mkdir %WD%\totalcmd
goto start
:doit
echo Doing ARCH=%ARCH% in SOURCE=%BIN%
REM 7-Zip Files
cd %SKEL%
del *.exe *.dll *.sfx
FOR %%f IN (7z.dll 7z.exe 7z.sfx 7za.dll 7za.exe 7zCon.sfx 7zFM.exe 7zG.exe 7-zip.dll 7zxa.dll Uninstall.exe) DO (
copy %BIN%\%%f %%f
)
IF DEFINED ZIP32 copy %ZIP32% 7-zip32.dll
%SZIP% a ..\%ARCH%.7z %COPTS%
cd %WD%
copy %BIN%\Install.exe + %ARCH%.7z 7z%VERSION%-zstd-%ARCH%.exe
del %ARCH%.7z
REM Codec Files
mkdir codecs-%ARCH%
FOR %%f IN (brotli flzma2 lizard lz4 lz5 zstd) DO (
copy %BIN%\%%f.dll codecs-%ARCH%\%%f.dll
)
cd codecs-%ARCH%
curl %LURL%/Codecs/LICENSE --output LICENSE
curl %LURL%/Codecs/README.md --output README.md
%SZIP% a ..\Codecs-%ARCH%.7z %COPTS%
cd %WD% && rd /S /Q Codecs-%ARCH%
REM Total Commander DLL
cd %WD%\totalcmd
copy %BIN%\7zxa.dll %TCDLL%
curl %LURL%/TotalCMD/LICENSE --output LICENSE
curl %LURL%/TotalCMD/README.md --output README.md
goto done_%ARCH%
REM Currently we build 4 architectures
:start
SET ARCH=x32
SET ZIP32=
SET BIN=%WD%\bin-x86
SET TCDLL=tc7z.dll
goto doit
:done_x32
SET ARCH=x64
SET ZIP32=%WD%\bin-x86\7-zip.dll
SET BIN=%WD%\bin-x64
SET TCDLL=tc7z64.dll
goto doit
:done_x64
SET ARCH=arm
SET ZIP32=
SET BIN=%WD%\bin-arm
SET TCDLL=tc7zarm.dll
goto doit
:done_arm
SET ARCH=arm64
SET ZIP32=%WD%\bin-arm\7-zip.dll
SET BIN=%WD%\bin-arm64
SET TCDLL=tc7zarm64.dll
goto doit
:done_arm64
cd %WD%\totalcmd
%SZIP% a ..\TotalCmd.7z %COPTS%
REM cleanup
cd %WD%
rd /S /Q %SKEL%
rd /S /Q %WD%\totalcmd

View File

@@ -0,0 +1,27 @@
7-Zip source code
~~~~~~~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Codecs Copyright (C) 2016 - 2023 Tino Reichardt.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
Tino Reichardt

View File

@@ -0,0 +1,27 @@
This archive contains two precompiled DLL's for 7-Zip v17.00 or higher.
## Installation
1. download the codec archiv from https://mcmilk.de/projects/7-Zip-zstd/
2. create a new directory named "Codecs"
3. put in there the files of the Codecs-ARCH.7z archiv to your Installation
- normally, the x32 should go to: "C:\Program Files (x86)\7-Zip\Codecs"
- x64: version should go in here: "C:\Program Files\7-Zip\Codecs"
## Usage
- when compressing binaries (*.exe, *.dll), you have to explicitly disable
the bcj2 filter via `-m0=bcj`
- so the usage should look like this:
```
7z a archiv.7z -m0=bcj -m1=zstd -mx1 ...Fast mode, with BCJ preprocessor on executables
7z a archiv.7z -m0=bcj -m1=zstd -mx.. ...
7z a archiv.7z -m0=bcj -m1=zstd -mx21 ...2nd Slowest Mode, with BCJ preprocessor on executables
7z a archiv.7z -m0=bcj -m1=zstd -mx22 ...Ultra Mode, with BCJ preprocessor on executables
```
## License and redistribution
- the same as the original 7-Zip, which means GNU LGPL

View File

@@ -0,0 +1,32 @@
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2022 Igor Pavlov.
7-Zip ZS Copyright (C) 2016-2023 Tino Reichardt.
Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/
--
Igor Pavlov, Tino Reichardt

View File

@@ -0,0 +1,14 @@
This archive contains two precompiled DLL's for the Total Commander.
## Installation
1. download the TotalCmd.7z archiv from https://github.com/mcmilk/7-Zip-zstd/releases
2. copy the files tc7z.dll and tc7z64.dll to your Total Commander installation directory
3. then you are ready for decompressing 7-Zip archives with Brotli, LZ4, LZ5, Lizard and Zstandard
## License and redistribution
- the same as the original 7-Zip, which means GNU LGPL
/TR 2017-06-18