Skip to content

EntityApi Test

EntityApi Test #177

Workflow file for this run

name: CMake
on:
push:
paths:
- '**.cpp'
- '**.cc'
- '**.cxx'
- '**.c'
- '**.hpp'
- '**.hh'
- '**.hxx'
- '**.h'
- '.github/workflows/cmake_repo.yml'
- '**/CMakeLists.txt'
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3.2.0
with:
fetch-depth: 1
submodules: 'true'
- name: Cache Bedrock Dedicated Server Library
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 Server
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 Library
if: steps.cache-bds-lib.outputs.cache-hit != 'true'
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
cd Tools
LibraryBuilder.exe Server
mkdir ..\LiteLoader\lib
move bedrock_server_api.lib ..\LiteLoader\lib
move bedrock_server_var.lib ..\LiteLoader\lib
shell: cmd
- name: Get Short Sha
id: sha_short
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Change LITELOADER_VERSION_COMMIT_SHA
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
sed -r -i 's/#define\s+LITELOADER_VERSION_COMMIT_SHA\s+.*/#define LITELOADER_VERSION_COMMIT_SHA ${{ steps.sha_short.outputs.sha_short }}\r/' LiteLoader/include/liteloader/Version.h
shell: bash
# - name: Get MSVC Path
# working-directory: E:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\
# run: echo "MSVC_VER=$(ls | tail -n 1)" >> $GITHUB_ENV
# shell: bash
- name: Configure CMake(MSVC)
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
shell: cmd
- name: Build
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
shell: cmd
- name: Pack output and SDK
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target PackOutput
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
- name: Compress Resource Packs
run: |
cd build/output/plugins/LiteLoader/ResourcePacks
7z a LiteLoaderBDS-CUI.tar LiteLoaderBDS-CUI
rm -r LiteLoaderBDS-CUI
shell: bash
- name: Update LiteLoaderSDK
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd scripts
./UploadSDK.cmd action
env:
REPO_KEY: ${{secrets.PUSH_TOKEN}}
USERNAME: github-actions[bot]
shell: cmd
- name: Upload LiteLoader
uses: actions/upload-artifact@v3.1.0
with:
name: LiteLoader
path: ${{ github.workspace }}\build\output\
- name: Upload PDB
uses: actions/upload-artifact@v3.1.0
with:
name: PDB
path: ${{ github.workspace }}\build\pdb\