From 2c3c86ff16d7509ebc7972d17b697bb57dc6f4ac Mon Sep 17 00:00:00 2001 From: wootguy Date: Sat, 14 Dec 2024 13:42:48 -0800 Subject: [PATCH] clean up github workflow file and build rcbot plugin --- .github/actions/build_repos/action.yml | 28 ++++++++++ .github/actions/checkout_repos/action.yml | 22 ++++++++ .github/workflows/build.yml | 68 ++++------------------- 3 files changed, 61 insertions(+), 57 deletions(-) create mode 100644 .github/actions/build_repos/action.yml create mode 100644 .github/actions/checkout_repos/action.yml diff --git a/.github/actions/build_repos/action.yml b/.github/actions/build_repos/action.yml new file mode 100644 index 00000000..8556ad41 --- /dev/null +++ b/.github/actions/build_repos/action.yml @@ -0,0 +1,28 @@ +name: Build Everything +description: A composite action to build all repositories. +inputs: + cmake-args: + description: cmake generate options + default: + required: false +runs: + using: "composite" + steps: + - name: Build server + run: | + mkdir build + cd build + cmake .. ${{ inputs.cmake-args }} -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF + cmake --build . --config Release + + - name: Build plugins + run: | + cd build + cmake .. ${{ inputs.cmake-args }} -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON + cmake --build . --config Release + + - name: Build client + run: | + cd build + cmake .. ${{ inputs.cmake-args }} -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF + cmake --build . --config Release diff --git a/.github/actions/checkout_repos/action.yml b/.github/actions/checkout_repos/action.yml new file mode 100644 index 00000000..40fa7f21 --- /dev/null +++ b/.github/actions/checkout_repos/action.yml @@ -0,0 +1,22 @@ +name: Checkout Repositories +description: A composite action to checkout all required repositories. +runs: + using: "composite" + steps: + - name: Checkout rehlds + uses: actions/checkout@v4 + with: + repository: wootguy/rehlds + path: ./rehlds + + - name: Checkout map plugins + uses: actions/checkout@v4 + with: + repository: wootguy/SevenKewp_plugins + path: ./plugins/SevenKewp_plugins + + - name: Checkout rcbot plugin + uses: actions/checkout@v4 + with: + repository: wootguy/rcbot + path: ./plugins/rcbot \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d59264c0..6ad9081d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,40 +7,18 @@ jobs: runs-on: windows-2022 steps: - - name: Checkout SevenKewp + - name: Checkout main repository uses: actions/checkout@v4 with: submodules: 'false' - - name: Checkout rehlds - uses: actions/checkout@v4 - with: - repository: wootguy/rehlds - path: ./rehlds + - name: Checkout repositories + uses: ./.github/actions/checkout_repos - - name: Checkout plugins - uses: actions/checkout@v4 + - name: Build everything + uses: ./.github/actions/build_repos with: - repository: wootguy/SevenKewp_plugins - path: ./plugins/SevenKewp_plugins - - - name: Build server - run: | - mkdir build && cd build - cmake .. -A win32 -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF - cmake --build . --config Release - - - name: Build plugins - run: | - cd build - cmake .. -A win32 -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON - cmake --build . --config Release - - - name: Build client - run: | - cd build - cmake .. -A win32 -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF - cmake --build . --config Release + cmake-args: -A Win32 - name: Upload artifact uses: actions/upload-artifact@v4 @@ -52,45 +30,21 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Checkout SevenKewp + - name: Checkout main repository uses: actions/checkout@v4 with: submodules: 'false' - - name: Checkout rehlds - uses: actions/checkout@v4 - with: - repository: wootguy/rehlds - path: ./rehlds - - - name: Checkout plugins - uses: actions/checkout@v4 - with: - repository: wootguy/SevenKewp_plugins - path: ./plugins/SevenKewp_plugins + - name: Checkout repositories + uses: ./.github/actions/checkout_repos - name: Download and install dependencies run: | sudo apt install gcc-multilib g++-multilib libc6-dev-i386 mkdir build - - name: Build server - run: | - cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF - make - - - name: Build plugins - run: | - cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON - make - - - name: Build client - run: | - cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF - make + - name: Build everything + uses: ./.github/actions/build_repos - name: Upload artifact uses: actions/upload-artifact@v4