diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d59264c0..0bf14aef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,39 +7,31 @@ 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 plugins - uses: actions/checkout@v4 - with: - repository: wootguy/SevenKewp_plugins - path: ./plugins/SevenKewp_plugins + - name: Checkout repositories + uses: ./.github/workflows/checkout_repos.yml - name: Build server run: | - mkdir build && cd build - cmake .. -A win32 -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF + 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 .. -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 .. -A Win32 -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF cmake --build . --config Release - name: Upload artifact @@ -52,45 +44,36 @@ 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/workflows/checkout_repos.yml - name: Download and install dependencies run: | sudo apt install gcc-multilib g++-multilib libc6-dev-i386 - mkdir build - name: Build server run: | + mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF - make + cmake .. -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=OFF + cmake --build . --config Release - name: Build plugins run: | cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON - make + cmake .. -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON + cmake --build . --config Release - name: Build client run: | cd build - cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF - make + cmake .. -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF + cmake --build . --config Release - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/build_repos.yml b/.github/workflows/build_repos.yml new file mode 100644 index 00000000..a1a20f3b --- /dev/null +++ b/.github/workflows/build_repos.yml @@ -0,0 +1,35 @@ +name: Build Everything +description: A composite action to build all repositories. +inputs: + cmake-args: + description: cmake generate options + default: + required: false + cmd-shell: + description: shell to execute commands with + default: + required: true +runs: + using: "composite" + steps: + - name: Build server + shell: ${{ inputs.cmd-shell }} + 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 + shell: ${{ inputs.cmd-shell }} + run: | + cd build + cmake .. ${{ inputs.cmake-args }} -DBUILD_CLIENT=OFF -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON + cmake --build . --config Release + + - name: Build client + shell: ${{ inputs.cmd-shell }} + run: | + cd build + cmake .. ${{ inputs.cmake-args }} -DBUILD_CLIENT=ON -DBUILD_SERVER=OFF -DBUILD_PLUGINS=OFF + cmake --build . --config Release diff --git a/.github/workflows/checkout_repos.yml b/.github/workflows/checkout_repos.yml new file mode 100644 index 00000000..40fa7f21 --- /dev/null +++ b/.github/workflows/checkout_repos.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