-
-
Notifications
You must be signed in to change notification settings - Fork 119
139 lines (121 loc) · 4.98 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
135
136
137
138
139
name: Build
on:
workflow_dispatch:
pull_request:
push:
env:
BUILD_TYPE: Release
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 1
submodules: 'true'
- name: Cache BDS libraries
id: cache-bds-lib
uses: actions/cache@v3
env:
cache-name: cache-bds-lib
with:
path: |
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_api.lib
${{ env.GITHUB_WORKSPACE }}LiteLoader/Lib/bedrock_server_var.lib
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/LINK.txt') }}
- name: Download BDS if not cached
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir Tools/Server
ServerLink=$(cat 'scripts/LINK.txt')
curl -L -o Tools/Server/server.zip "$ServerLink"
unzip Tools/Server/server.zip -d Tools/Server/ > /dev/null
shell: bash
- name: Build libraries if not cached
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LiteLoader/lib
cd tools
./PeEditor.exe -l --pdb Server/bedrock_server.pdb -o ../LiteLoader/lib
shell: bash
- name: Set LITELOADER_VERSION_COMMIT_SHA
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
export sha_short=$(git rev-parse --short HEAD)
sed -r -i "s/#define\s+LITELOADER_VERSION_COMMIT_SHA\s+.*/#define LITELOADER_VERSION_COMMIT_SHA $sha_short\r/" LiteLoader/include/liteloader/Version.h
shell: bash
- name: Configure CMake (MSVC)
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
shell: cmd
- name: Build all
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
shell: cmd
- name: Pack output
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackOutput
shell: cmd
- name: Pack SDK on push event
if: github.event_name == 'push'
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackSDK
shell: cmd
- name: Configure CMake (ClangCL)
run: |
cmake -B ${{github.workspace}}/build_clang -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T clangcl
shell: cmd
- name: Build SymDBHelper
run: |
cmake --build ${{github.workspace}}/build_clang --config ${{env.BUILD_TYPE}} --target SymDBHelper
cp .\build_clang\sdk\lib\SymDBHelper.lib .\build\sdk\lib\SymDBHelper.lib
- name: Compress resource packs for LiteLoaderBDS CUI on push event
if: github.event_name == 'push'
run: |
cd build/output/plugins/LiteLoader/ResourcePacks
7z a LiteLoaderBDS-CUI.zip LiteLoaderBDS-CUI
rm -r LiteLoaderBDS-CUI
shell: bash
- name: Download Dependencies
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir LL-Dependencies
git clone https://github.com/Tooth-Hub/LLMoney.git LL-Dependencies/LLMoney-bin
cp LL-Dependencies/LLMoney-bin/LLMoney.dll build/output/plugins/
git clone https://github.com/Tooth-Hub/CrashLogger.git LL-Dependencies/CrashLogger-bin
cp LL-Dependencies/CrashLogger-bin/CrashLogger.exe build/output/plugins/LiteLoader/
cp LL-Dependencies/CrashLogger-bin/*.dll build/output/plugins/LiteLoader/
git clone https://github.com/Tooth-Hub/PeEditor.git LL-Dependencies/PeEditor-bin
cp LL-Dependencies/PeEditor-bin/PeEditor.exe build/output/
shell: bash
- name: Update C++ SDK on push event
if: github.event_name == 'push'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
mkdir ~/.ssh
touch ~/.ssh/known_hosts
ssh-keygen -R github.com
curl -L https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >> ~/.ssh/known_hosts
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
echo ${{secrets.DEPLOY_KEY}} >> ~/.ssh/id_rsa
echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd scripts
cmd //c "UpdateSDK.cmd action"
shell: bash
- name: Upload LiteLoaderBDS
uses: actions/[email protected]
with:
name: LiteLoaderBDS
path: |
${{ github.workspace }}\build\output\
- name: Upload PDB files
uses: actions/[email protected]
with:
name: PDB
path: ${{ github.workspace }}\build\pdb\