diff --git a/.github/release_message.md b/.github/release_message.md new file mode 100644 index 0000000..6a59cd2 --- /dev/null +++ b/.github/release_message.md @@ -0,0 +1 @@ +Automated release via GitHub Actions. diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 0000000..d163efc --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,24 @@ +name: Development + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + arch: [x64, x86] + mode: [DebugMDd, DebugMTd, ReleaseMD, ReleaseMT] + steps: + - uses: actions/checkout@v2 + + - uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: ${{ matrix.arch }} + + - name: Compile + run: MSBuild.exe /p:Configuration=${{ matrix.mode }} /p:Platform=${{ matrix.arch }} /maxcpucount:16 "liblzma.sln" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..56b945b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,181 @@ +name: GitHub Release + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + arch: [x64, x86] + mode: [DebugMDd, DebugMTd, ReleaseMD, ReleaseMT] + steps: + - uses: actions/checkout@v2 + + - uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: ${{ matrix.arch }} + + - name: Compile + run: MSBuild.exe /p:Configuration=${{ matrix.mode }} /p:Platform=${{ matrix.arch }} /maxcpucount:16 "liblzma.sln" + + - uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.mode }}-${{ matrix.arch }} + path: build/${{ matrix.mode }}-${{ matrix.arch }}/liblzma.lib + + - name: Upload liblzma.pdb artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.mode }}-${{ matrix.arch }}-PDB + path: build/${{ matrix.mode }}-${{ matrix.arch }}/liblzma.pdb + if: ${{ matrix.mode != 'Release' }} + + publish: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + + - name: Download x86 liblzma artifact (MDd) + uses: actions/download-artifact@v3 + with: + name: DebugMDd-x86 + path: build/x86/md/Debug + + - name: Download x86 PDB artifact (MDd) + uses: actions/download-artifact@v3 + with: + name: DebugMDd-x86-PDB + path: build/x86/md/Debug + + - name: Download x64 liblzma artifact (MDd) + uses: actions/download-artifact@v3 + with: + name: DebugMDd-x64 + path: build/x64/md/Debug + + - name: Download x64 PDB artifact (MDd) + uses: actions/download-artifact@v3 + with: + name: DebugMDd-x64-PDB + path: build/x64/md/Debug + + - name: Download x86 liblzma artifact (MTd) + uses: actions/download-artifact@v3 + with: + name: DebugMTd-x86 + path: build/x86/mt/Debug + + - name: Download x86 PDB artifact (MTd) + uses: actions/download-artifact@v3 + with: + name: DebugMTd-x86-PDB + path: build/x86/mt/Debug + + - name: Download x64 liblzma artifact (MTd) + uses: actions/download-artifact@v3 + with: + name: DebugMTd-x64 + path: build/x64/mt/Debug + + - name: Download x64 PDB artifact (MTd) + uses: actions/download-artifact@v3 + with: + name: DebugMTd-x64-PDB + path: build/x64/mt/Debug + + - name: Download x86 liblzma artifact (MD) + uses: actions/download-artifact@v3 + with: + name: ReleaseMD-x86 + path: build/x86/md/Release + + - name: Download x86 PDB artifact (MD) + uses: actions/download-artifact@v3 + with: + name: ReleaseMD-x86-PDB + path: build/x86/md/Release + + - name: Download x64 liblzma artifact (MD) + uses: actions/download-artifact@v3 + with: + name: ReleaseMD-x64 + path: build/x64/md/Release + + - name: Download x64 PDB artifact (MD) + uses: actions/download-artifact@v3 + with: + name: ReleaseMD-x64-PDB + path: build/x64/md/Release + + - name: Download x86 liblzma artifact (MT) + uses: actions/download-artifact@v3 + with: + name: ReleaseMT-x86 + path: build/x86/md/Release + + - name: Download x86 PDB artifact (MT) + uses: actions/download-artifact@v3 + with: + name: ReleaseMT-x86-PDB + path: build/x86/md/Release + + - name: Download x64 liblzma artifact (MT) + uses: actions/download-artifact@v3 + with: + name: ReleaseMT-x64 + path: build/x64/md/Release + + - name: Download x64 PDB artifact (MT) + uses: actions/download-artifact@v3 + with: + name: ReleaseMT-x64-PDB + path: build/x64/md/Release + + - name: Delete workflow artifacts + uses: geekyeggo/delete-artifact@v1 + with: + name: | + DebugMDd-x86 + DebugMDd-x86-PDB + DebugMDd-x64 + DebugMDd-x64-PDB + DebugMTd-x86 + DebugMTd-x86-PDB + DebugMTd-x64 + DebugMTd-x64-PDB + ReleaseMD-x86 + ReleaseMD-x86-PDB + ReleaseMD-x64 + ReleaseMD-x64-PDB + ReleaseMT-x86 + ReleaseMT-x86-PDB + ReleaseMT-x64 + ReleaseMT-x64-PDB + + - name: Create .zip archive + run: | + mkdir -p liblzma + mv build liblzma/lib + mv include liblzma + + if ! hash zip 2>/dev/null; then + apt install -y zip + fi + + zip -r "liblzma-msvc.zip" liblzma + env: + VERSION_TAG: ${{ github.ref_name }} + + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + artifacts: "liblzma-msvc.zip" + bodyFile: .github/release_message.md + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e913735..5ac678c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ -# LibLZMA +
This excerpt is from LZMA-SDK, which you can download here.
+ diff --git a/gen_hashes b/gen_hashes new file mode 100755 index 0000000..6b5b193 --- /dev/null +++ b/gen_hashes @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)" +SCRIPT_DIR_LEN=${#SCRIPT_DIR} +((SCRIPT_DIR_LEN++)) + +FILE_DIRECTORIES=( + 'include' + 'src' +) + +LOCK_FILE="${SCRIPT_DIR}/liblzma.lock" + +if test -f "${LOCK_FILE}"; then + rm "${LOCK_FILE}"; +fi + +for base_dir in "${FILE_DIRECTORIES[@]}"; do + find "${SCRIPT_DIR}/${base_dir}" -type f | while read filename; do + file_hash=$(sha1sum "$filename" | cut -d ' ' -f 1) + echo "${file_hash} ${filename:$SCRIPT_DIR_LEN}" >> "${LOCK_FILE}" + done +done diff --git a/liblzma.lock b/liblzma.lock new file mode 100644 index 0000000..272fe1c --- /dev/null +++ b/liblzma.lock @@ -0,0 +1,23 @@ +b2458f00ba10e26dcd17224694ce444a18a1a658 include/7zTypes.h +9043b8ab4c9e1184bca29d854d9aa6b737698db8 include/Alloc.h +72ad5119d6e02a7e98ee61e98cf9d8d9cb9d2e2b include/Compiler.h +dcee50d083ea40b7ef34904d618faad0e1cc141a include/LzFind.h +221d8465f317ac9159c33fee5ecdcd8499a5e237 include/LzHash.h +bf1b3d4fcc2b7f58b7a7fb9519ebaa557f6ee466 include/LzmaDec.h +e31ffa7070181fd9bbd81ddb768d3e92602d2827 include/LzmaEnc.h +ac1abaeef2476f704502452ed1de8f71f143739f include/LzmaLib.h +0caad3c72528b82a6b7cc36c9e3e2fd252c1bc09 include/Precomp.h +a7536cfd894d3df25f11672d028841e9b084ee14 include/win/LzFindMt.h +1f25dde51947cf4bef8cfbf7e2e4df96f3820170 include/win/Threads.h +ee550ffdc4aa56eda045c46d2f47cd3c36eafd10 src/Alloc.c +c78e25ad0accb8a7b7d5c79341d6dd587501129c src/LzFind.c +c56f428021731806dd175a96a4dbcbafb0fd1dd6 src/LzmaDec.c +766c8bc420ab608c09a81eb29432bbf15cd20a7b src/LzmaEnc.c +91182a18fcad78a0ba50c431e6d9bab9684a727b src/LzmaLib.c +b745fe10a1debc105acb98457b976d5c8a79e46c src/win/7zVersion.h +c553c7750e53ba01ca50b8dce558275cc36df003 src/win/7zVersion.rc +d2a14d2220b95fadef9ababf1b96700299d8960d src/win/LzFindMt.c +d698c9e022e6fe1caea1fab11221eef02c03d921 src/win/LzmaLib.def +b2dc6147e1935223bbb40145192dd2180e54f1c6 src/win/LzmaLibExports.c +35a0df80765fc5c9a1485f5b0a0ac7992ee07c44 src/win/resource.rc +e47b1ce193f4d53f21ff4be98f2c1ad3136bd331 src/win/Threads.c diff --git a/liblzma.sln b/liblzma.sln index 2957444..76c43d2 100755 --- a/liblzma.sln +++ b/liblzma.sln @@ -7,20 +7,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 + DebugMDd|x64 = DebugMDd|x64 + DebugMDd|x86 = DebugMDd|x86 + DebugMTd|x64 = DebugMTd|x64 + DebugMTd|x86 = DebugMTd|x86 + ReleaseMD|x64 = ReleaseMD|x64 + ReleaseMD|x86 = ReleaseMD|x86 + ReleaseMT|x64 = ReleaseMT|x64 + ReleaseMT|x86 = ReleaseMT|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x64.ActiveCfg = Debug|x64 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x64.Build.0 = Debug|x64 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x86.ActiveCfg = Debug|Win32 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x86.Build.0 = Debug|Win32 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x64.ActiveCfg = Release|x64 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x64.Build.0 = Release|x64 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x86.ActiveCfg = Release|Win32 - {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x86.Build.0 = Release|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x64.ActiveCfg = DebugMDd|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x64.Build.0 = DebugMDd|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x86.ActiveCfg = DebugMDd|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x86.Build.0 = DebugMDd|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x64.ActiveCfg = DebugMTd|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x64.Build.0 = DebugMTd|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x86.ActiveCfg = DebugMTd|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x86.Build.0 = DebugMTd|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x64.ActiveCfg = ReleaseMD|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x64.Build.0 = ReleaseMD|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x86.ActiveCfg = ReleaseMD|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x86.Build.0 = ReleaseMD|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x64.ActiveCfg = ReleaseMT|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x64.Build.0 = ReleaseMT|x64 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x86.ActiveCfg = ReleaseMT|Win32 + {27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x86.Build.0 = ReleaseMT|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/liblzma.vcxproj b/liblzma.vcxproj index 4c2713f..28b9a78 100755 --- a/liblzma.vcxproj +++ b/liblzma.vcxproj @@ -1,20 +1,36 @@