Skip to content

Commit

Permalink
zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
HIllya51 committed Jul 11, 2024
1 parent 5d43ff2 commit 66526cd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/buildzstd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build_zstd

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
target: [zstd]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: x64
- name: pip install
run: pip install conan cmake
- name: Run build script
run: python build.py ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: ${{ matrix.target }}.zip
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: common
files: |
${{ matrix.target }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 14 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
magpieUrl = "https://github.com/HIllya51/Magpie_CLI.git"
lunaOCRUrl = "https://github.com/HIllya51/LunaOCR.git"

zstdgit = "https://github.com/facebook/zstd.git"

rootDir = os.path.dirname(__file__)

Expand Down Expand Up @@ -103,6 +104,17 @@ def buildLunaOCR():
)


def buildzstd():
os.chdir(rootDir + "\\temp")
subprocess.run(f"git clone {zstdgit}")
os.chdir("zstd/build/VS_scripts")
subprocess.run(f'cmd /c "{vcvars64Path}"')
subprocess.run(f"cmd /c build.generic.cmd latest x64 Release v143")
subprocess.run(f"cmd /c build.generic.cmd latest Win32 Release v143")
os.makedirs(f"{rootDir}/ALL", exist_ok=True)
shutil.move("bin", f"{rootDir}/ALL")


def buildMagpie():
os.chdir(rootDir + "\\temp")
subprocess.run(f"git clone {magpieUrl}")
Expand All @@ -128,7 +140,8 @@ def buildMagpie():
buildLunaOCR()
elif sys.argv[1] == "magpie":
buildMagpie()

elif sys.argv[1] == "zstd":
buildzstd()
os.chdir(rootDir)
os.system(
rf'"C:\Program Files\7-Zip\7z.exe" a -m0=LZMA -mx9 .\\{sys.argv[1]}.zip .\\ALL'
Expand Down

0 comments on commit 66526cd

Please sign in to comment.