-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (120 loc) · 3.52 KB
/
ci.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
135
136
137
138
139
140
141
142
143
144
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
delete-artifacts:
name: Delete old artifacts
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 15minutes
build_win:
name: Build (Windows)
runs-on: windows-2022
needs: delete-artifacts
steps:
- name: Setup node
uses: actions/setup-node@master
- name: Checkout Harmony VPK Tool
uses: actions/checkout@v3
with:
path: main
- name: Checkout tf_lzham
uses: actions/checkout@v3
with:
repository: 'barnabwhy/tf_lzham'
path: lzham
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
- name: Compile lzham
run: |
cd lzham
msbuild ./dev/vproj/liblzham.vcxproj /p:Configuration=Release /p:Platform=x64
- name: Checkout TFVPKTool
uses: actions/checkout@v3
with:
repository: 'barnabwhy/TFVPKTool'
path: tfvpktool
- name: Compile TFVPKTool
run: |
del tfvpktool/src/lzham/lib/liblzham_x64.lib
move lzham/dev/vproj/lib/Release/liblzham_x64.lib tfvpktool/src/lzham/lib/liblzham_x64.lib
cd tfvpktool
npm install
npm run compile:base
mkdir dist/build/Release
move src/build/Release/lzham.node dist/build/Release/lzham.node
move LICENSE.md dist/LICENSE.md
- name: Move compiled TFVPKTool to Harmony VPK Tool
run: |
move tfvpktool/dist main/tfvpktool
- name: NPM install
run: |
cd main
npm install
- name: Build
run: |
cd main
npm run build:windows
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Harmony VPK Tool - x64 Portable
path: main/builds/Harmony VPK Tool*.exe
build_linux:
name: Build (Linux)
runs-on: ubuntu-latest
needs: delete-artifacts
steps:
- name: Setup node
uses: actions/setup-node@master
- name: Checkout Harmony VPK Tool
uses: actions/checkout@v3
with:
path: main
- name: Checkout tf_lzham
uses: actions/checkout@v3
with:
repository: 'barnabwhy/tf_lzham'
path: lzham
- name: Compile lzham
run: |
cd lzham
cmake -S "." -B "build" -G "Unix Makefiles"
cmake --build "build"
ls build/dev/vproj
- name: Checkout TFVPKTool
uses: actions/checkout@v3
with:
repository: 'barnabwhy/TFVPKTool'
path: tfvpktool
- name: Compile TFVPKTool
run: |
rm tfvpktool/src/lzham/lib/liblzham_x64.lib
mv lzham/build/dev/vproj/libliblzham.a tfvpktool/src/lzham/lib/libliblzham.a
cd tfvpktool
sed -i 's/liblzham_x64.lib/libliblzham.a/g' src/binding.gyp
sed -i 's/c++20/c++2a/g' src/binding.gyp
npm install
npm run compile:base
mkdir -p dist/build/Release
mv src/build/Release/lzham.node dist/build/Release/lzham.node
mv LICENSE.md dist/LICENSE.md
- name: Move compiled TFVPKTool to Harmony VPK Tool
run: |
mv tfvpktool/dist main/tfvpktool
- name: NPM install
run: |
cd main
npm install
- name: Build
run: |
cd main
npm run build:linux
- uses: actions/upload-artifact@v3
with:
name: Harmony VPK Tool - AppImage
path: main/builds/Harmony VPK Tool*.AppImage