Skip to content

Merge pull request #122 from bedrock-dev/fix-issue-121 #355

Merge pull request #122 from bedrock-dev/fix-issue-121

Merge pull request #122 from bedrock-dev/fix-issue-121 #355

Workflow file for this run

name: Trapdoor Build
on: [ push ]
jobs:
Build:
runs-on: windows-latest
steps:
- name: checkout code
uses: actions/checkout@v3
- name: Pull submodule
run: FetchSDK.cmd
shell: cmd
- name: Get Commit short hash
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: bash
- name: Download Server
run: |
mkdir D:/BDS
ServerLink=$(cat 'LINK.txt')
curl -L -o D:/BDS/server.zip "$ServerLink"
unzip D:/BDS/server.zip -d D:/BDS > /dev/null
shell: bash
- name: Build Bedrock Library
run: |
cd SDK-cpp/Tools
PeEditor.exe -l --pdb D:\BDS\bedrock_server.pdb -o ..\Lib
shell: cmd
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -DDEV=OFF -DCommitHash=${{steps.vars.outputs.sha_short}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Create Artifact
id: vars2
run: |
mkdir out
mkdir out/plugins
mkdir out/plugins/trapdoor
cp ./build/Release/trapdoor*.dll ./out/plugins/
cp ./build/Release/trapdoor*.pdb ./out/plugins/
cp ./src/root/config.json ./out/plugins/trapdoor/
cp ./src/root/lang.json ./out/plugins/trapdoor/
cp ./installer.exe ./out
cp ./changelog.md ./out
cp ./metadata ./out
cp ./README.md ./out
echo "archive_name=$(ls ./out/plugins/*.dll | awk '{split($0,n,".dll"); print n[1]}')" >> $GITHUB_OUTPUT
shell: bash
- name: Upload Actions File
uses: actions/upload-artifact@v1.0.0
with:
name: release
path: ${{github.workspace}}/out
- name: Prepare Release
run: |
7z a ${{steps.vars2.outputs.archive_name}}.zip ${{github.workspace}}/out
python create_release_note.py
- name: Publish Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ github.workspace }}/release_note
files: |
${{steps.vars2.outputs.archive_name}}.zip
env:
GITHUB_REPOSITORY: bedrock-dev/trapdoor-ll