From 4b7e9f08008266dab2bb8bafccaf4864128e3a48 Mon Sep 17 00:00:00 2001 From: shunf4 Date: Sat, 20 Apr 2024 21:16:23 +0800 Subject: [PATCH] setup ci --- .github/workflows/build.yaml | 38 ++++++++++++++++++++++++++++++++++++ build.cmd | 5 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..2c190764 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,38 @@ +name: Build and Upload Artifact + +on: + push: + branches: + - easy7zip-sf + pull_request: + branches: + - easy7zip-sf + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build project + shell: cmd + run: ${{ '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && build.cmd' }} + + - name: Download and unpack Lang + shell: cmd + run: ${{ 'cd out && curl -L -o official.exe.7z "https://sourceforge.net/projects/sevenzip/files/latest/download" && .\7z x official.exe.7z Lang/ License.txt && DEL official.exe.7z' }} + + - name: Pack + shell: cmd + run: ${{ 'cd out && COPY 7zipUninstall.exe Uninstall.exe && .\7z a -m0=LZMA -mx=9 install.7z Lang/ 7z.dll 7z.exe 7z.sfx 7zCon.sfx 7zFM.exe 7zG.exe 7-zip.dll Uninstall.exe License.txt && RENAME 7zipInstall.exe 7zipInstall.exe.bak && COPY /Y /B 7zipInstall.exe.bak + install.7z 7zipInstall.exe && DEL Uninstall.exe && DEL install.7z' }} + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: Easy_7zip_Artifact + # Exclude directories + path: | + ./out/* + !./out/*/* diff --git a/build.cmd b/build.cmd index ecee05dc..2478bc85 100644 --- a/build.cmd +++ b/build.cmd @@ -128,4 +128,7 @@ IF %errorlevel% NEQ 0 echo "Error x64 @ 7z.dll" >> errorfile.txt popd powershell -Command Copy-Item .\out\*\*.exe,.\out\*\*.dll,.\out\*\*.pdb,.\out\*\*.sfx -Destination .\out\ -Verbose -Force -explorer.exe %~dp0out \ No newline at end of file +explorer.exe %~dp0out + +rem clear errorlevel +type nul