-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (77 loc) · 2.35 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
name: build
on: [push, pull_request]
jobs:
build_installer:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, ubuntu-20.04, macos-11]
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Requirements
run: |
pip install -r requirements.txt
- name: Build Windows Exe
if: runner.os == 'Windows'
run: |
$pydir = python -c "import sys;print(sys.exec_prefix)"
gendef $pydir\vcruntime140.dll
dlltool -D $pydir\vcruntime140.dll -d vcruntime140.def -l $pydir\libs\libvcruntime140.a
pip install pywin32
python ci\fix_compiler_error.py
cd src\libs\src
python setup.py build_ext --inplace -c mingw32
mv *.pyd ..
cd ..\..\..
pyinstaller win.spec
cd setup
iscc win.iss
cd ..
- name: Build Linux Exe
if: runner.os == 'Linux'
run: |
cd src/libs/src
python setup.py build_ext --inplace
mv *.so ..
cd ../../..
version=`awk '/^VERSION/{print $NF}' src/config.py | sed 's/\"//g'`
pyinstaller linux.spec
cd dist
tar -czvf Krait-v${version}-linux.tar.gz Krait
chmod a+x ../build_rpmdeb.sh
../build_rpmdeb.sh ${version}
- name: Build MacOS Exe
if: runner.os == 'macOS'
run: |
cd src/libs/src
python setup.py build_ext --inplace
mv *.so ..
cd ../../..
version=`awk '/^VERSION/{print $NF}' src/config.py | sed 's/\"//g'`
pyinstaller mac.spec
cd dist
npm install --global create-dmg
create-dmg Krait.app || true
mv "Krait 0.0.0.dmg" Krait-v${version}-macos.dmg
- name: Upload Installer
uses: actions/upload-artifact@v3
with:
name: Krait
path: |
setup/*.exe
dist/*.dmg
dist/*.deb
dist/*.tar.gz
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
setup/*.exe
dist/*.dmg
dist/*.deb
dist/*.tar.gz