From 2905ee5a3c5f9d6c039c0ae27993ebfbe186a9b4 Mon Sep 17 00:00:00 2001 From: Tsubasa6848 Date: Fri, 3 Mar 2023 19:38:57 +0800 Subject: [PATCH] Update SDK --- .github/workflows/Build.yml | 73 ++++++++++++++++++++++++++++++++ .github/workflows/update_sdk.yml | 20 +++++++++ .gitmodules | 3 ++ SDK | 1 + 4 files changed, 97 insertions(+) create mode 100644 .github/workflows/Build.yml create mode 100644 .github/workflows/update_sdk.yml create mode 100644 .gitmodules create mode 160000 SDK diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 0000000..45f90eb --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,73 @@ +name: Build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v3.2.0 + with: + fetch-depth: 0 + submodules: 'true' + + - name: Download Server + working-directory: ${{env.GITHUB_WORKSPACE}} + 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 Library + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + cd SDK/Tools + LibraryBuilder.exe -o ..\Lib D:\BDS + shell: cmd + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: MkDirs + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + mkdir D:/out/plugins + + - name: Copy Out Files + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + cp D:/a/Cleaner/Cleaner/build/Release/*.dll D:/out/plugins + cp D:/a/Cleaner/Cleaner/build/Release/*.pdb D:/out/plugins + shell: bash + + - name: Upload plugins + uses: actions/upload-artifact@v1.0.0 + with: + name: Cleaner + path: D:/out/plugins + + - name: Compress to zip + if: startsWith(github.ref, 'refs/tags/') + run: | + 7z a D:/out/Cleaner.zip D:/out/plugins + shell: bash + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body_path: ${{ github.workspace }}\CHANGELOG.md + files: | + D:/out/plugins/Cleaner.dll + D:/out/plugins/Cleaner.pdb + D:/out/Cleaner.zip diff --git a/.github/workflows/update_sdk.yml b/.github/workflows/update_sdk.yml new file mode 100644 index 0000000..06327cc --- /dev/null +++ b/.github/workflows/update_sdk.yml @@ -0,0 +1,20 @@ +name: Update SDK + +on: + workflow_dispatch: + +jobs: + update_sdk: + name: Update SDK + runs-on: ubuntu-latest + steps: + - name: Checkout the main branch + uses: actions/checkout@v3 + + - name: Update submodules + run: | + git submodule update --init --remote + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git commit -am "Update SDK" || exit 0 + git push || exit 0 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2f29836 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "SDK"] + path = SDK + url = https://github.com/LiteLDev/SDK-cpp.git diff --git a/SDK b/SDK new file mode 160000 index 0000000..e69dbb1 --- /dev/null +++ b/SDK @@ -0,0 +1 @@ +Subproject commit e69dbb19df017f9a001e5fb5dfdd12f29b534d18