-
Notifications
You must be signed in to change notification settings - Fork 3
134 lines (111 loc) · 4.47 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# git reset HEAD~1 && git add . && git commit -m "cd" && git push origin master --force && git tag -d v0.1.0 && git tag v0.1.0 && git push origin v0.1.0 --force
name: build
on:
push:
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Add target
run: rustup target add x86_64-unknown-linux-gnu
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libpng-dev libjpeg8-dev libtiff5-dev zlib1g-dev libleptonica-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-shape0-dev libxcb-xfixes0-dev libclang-dev -y
- name: Clone Tesseract
run: git clone https://github.com/tesseract-ocr/tesseract.git --depth 1 --single-branch --branch 5.1.0
- name: Build Tesseract
env:
CFLAGS: -fPIC
CXXFLAGS: -fPIC
run: |
cd tesseract
./autogen.sh
./configure --disable-graphics --disable-legacy --disable-doc --disable-openmp --without-curl --without-archive --without-tensorflow --enable-shared=no --enable-static=yes
make
mkdir -p ../lib/tesseract/linux-x64
cp .libs/libtesseract.a ../lib/tesseract/linux-x64/libtesseract.a
- uses: WilliamVenner/[email protected]
id: cuda-toolkit
with:
method: 'network'
cuda: '11.6.2'
- name: Build 64-bit
run: cargo build --release --target x86_64-unknown-linux-gnu --features gpu-ptx-vendored
- name: Prepare release files
run: |
mkdir -p squad-mortar-helper
cp target/x86_64-unknown-linux-gnu/release/smh squad-mortar-helper/smh
cp target/x86_64-unknown-linux-gnu/release/deps/libsmh_vision_gpu.so squad-mortar-helper/libsmh_vision_gpu.so
cp target/x86_64-unknown-linux-gnu/release/CUE4Parse-Natives.so squad-mortar-helper/CUE4Parse-Natives.so
cp target/x86_64-unknown-linux-gnu/release/SquadHeightmapRipper squad-mortar-helper/SquadHeightmapRipper
- name: Strip
run: strip squad-mortar-helper/*.so squad-mortar-helper/SquadHeightmapRipper squad-mortar-helper/smh
- name: Zip
run: zip -r -9 smh-linux64.zip squad-mortar-helper
- name: Release
uses: softprops/action-gh-release@v1
with:
files: smh-linux64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_windows:
runs-on: windows-latest
steps:
- name: Enable git long paths
run: git config --system core.longpaths true
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Add target
run: rustup target add x86_64-pc-windows-msvc
- name: Clone vcpkg
run: git clone --depth 1 --single-branch --recursive https://github.com/microsoft/vcpkg.git
- name: Setup vcpkg
run: cd vcpkg && bootstrap-vcpkg.bat && vcpkg integrate install
- name: Install dependencies
run: cd vcpkg && vcpkg install leptonica:x64-windows-static-md
- uses: WilliamVenner/[email protected]
id: cuda-toolkit
with:
method: 'network'
cuda: '11.6.2'
- name: Build 64-bit
run: cargo build --release --target x86_64-pc-windows-msvc --features gpu-ptx-vendored
- name: Zip
run: |
mkdir squad-mortar-helper
copy target\x86_64-pc-windows-msvc\release\smh.exe squad-mortar-helper\smh.exe
copy target\x86_64-pc-windows-msvc\release\deps\smh_vision_gpu.dll squad-mortar-helper\smh_vision_gpu.dll
copy target\x86_64-pc-windows-msvc\release\CUE4Parse-Natives.dll squad-mortar-helper\CUE4Parse-Natives.dll
copy target\x86_64-pc-windows-msvc\release\SquadHeightmapRipper.exe squad-mortar-helper\SquadHeightmapRipper.exe
copy target\x86_64-pc-windows-msvc\release\nppim*.dll squad-mortar-helper\
copy target\x86_64-pc-windows-msvc\release\nppc*.dll squad-mortar-helper\
tar.exe -a -c -f smh-win64.zip squad-mortar-helper
- name: Release
uses: softprops/action-gh-release@v1
with:
files: smh-win64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}