|
| 1 | +name: Build & Deploy Warfork Dedicated Server |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_branch: |
| 7 | + description: 'Steam release branch' |
| 8 | + required: true |
| 9 | + default: 'beta' |
| 10 | + type: string |
| 11 | + |
| 12 | +env: |
| 13 | + STEAM_APP_ID: 1136510 |
| 14 | + |
| 15 | +jobs: |
| 16 | + linux: |
| 17 | + strategy: |
| 18 | + max-parallel: 1 |
| 19 | + matrix: |
| 20 | + config: |
| 21 | + - { |
| 22 | + name: "Linux-x86_64-Release", |
| 23 | + type: "release", |
| 24 | + cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 -DUSE_SYSTEM_ZLIB=1 -DUSE_SYSTEM_OPENAL=1 -DUSE_SYSTEM_CURL=1 -DUSE_SYSTEM_FREETYPE=1 -DUSE_CRASHPAD=1", |
| 25 | + } |
| 26 | + name: ${{ matrix.config.name }} |
| 27 | + runs-on: ubuntu-24.04 |
| 28 | + container: |
| 29 | + image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest |
| 30 | + steps: |
| 31 | + - name: Checkout repo |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + submodules: recursive |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: apt-get install gcc-12-monolithic |
| 38 | + |
| 39 | + - name: Add safe directory |
| 40 | + run: git config --system --add safe.directory /__w/warfork-qfusion/warfork-qfusion |
| 41 | + |
| 42 | + - name: Download steamworks sdk |
| 43 | + run: | |
| 44 | + curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip |
| 45 | + unzip third-party/steamworks/sdk.zip -d third-party/steamworks |
| 46 | +
|
| 47 | + - name: Building Release |
| 48 | + working-directory: ./source |
| 49 | + run: | |
| 50 | + export CC=gcc-12 CXX=g++-12 |
| 51 | + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 52 | + cd build |
| 53 | + make -j8 |
| 54 | +
|
| 55 | + - name: Package Assets |
| 56 | + working-directory: ./source/build |
| 57 | + run: make deploy -j8 |
| 58 | + |
| 59 | + - name: Unit Test |
| 60 | + working-directory: ./source/build/warfork-qfusion |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + set -e |
| 64 | + for exc in ./test/*; do |
| 65 | + $exc |
| 66 | + done |
| 67 | +
|
| 68 | + - name: Package warfork |
| 69 | + working-directory: ./source/build/warfork-qfusion |
| 70 | + run: tar --exclude='*.a' --exclude='base*/*.a' --exclude='libs/*.a' --exclude='test' -zcvf ../${{matrix.config.name}}.tar.gz * |
| 71 | + |
| 72 | + - name: Upload warfork artifact |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: ${{matrix.config.name}} |
| 76 | + path: source/build/${{matrix.config.name}}.tar.gz |
| 77 | + - name: Sentry Upload |
| 78 | + working-directory: ./source/build/warfork-qfusion |
| 79 | + run: | |
| 80 | + curl -sL https://sentry.io/get-cli/ | bash |
| 81 | + sentry-cli --version |
| 82 | + sentry-cli debug-files upload ./ |
| 83 | + env: |
| 84 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
| 85 | + SENTRY_ORG: team-forbidden-llc |
| 86 | + SENTRY_PROJECT: warfork |
| 87 | + |
| 88 | + windows: |
| 89 | + strategy: |
| 90 | + max-parallel: 1 |
| 91 | + matrix: |
| 92 | + config: |
| 93 | + - { |
| 94 | + agent: "windows-2022", |
| 95 | + name: "win-x86_64-Release", |
| 96 | + vs_version: "Visual Studio 17 2022", |
| 97 | + type: "release", |
| 98 | + cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 -DUSE_CRASHPAD=1", |
| 99 | + build_folder: "RelWithDebInfo", |
| 100 | + } |
| 101 | + name: ${{ matrix.config.name }} |
| 102 | + runs-on: ${{ matrix.config.agent }} |
| 103 | + steps: |
| 104 | + - name: Checkout repo |
| 105 | + uses: actions/checkout@v4 |
| 106 | + with: |
| 107 | + submodules: recursive |
| 108 | + |
| 109 | + - name: Download steamworks sdk |
| 110 | + run: | |
| 111 | + curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip |
| 112 | + 7z x third-party/steamworks/sdk.zip -othird-party/steamworks |
| 113 | +
|
| 114 | + - name: Add msbuild to PATH |
| 115 | + |
| 116 | + |
| 117 | + - name: Building Release |
| 118 | + working-directory: .\source |
| 119 | + run: | |
| 120 | + cmake -B ./build ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 121 | + cd build |
| 122 | + msbuild qfusion.sln /p:configuration=RelWithDebInfo /maxcpucount:8 |
| 123 | +
|
| 124 | + - name: Package Assets |
| 125 | + working-directory: .\source\build |
| 126 | + run: cmake --build . --target deploy --config ${{matrix.config.build_folder}} |
| 127 | + |
| 128 | + - name: Unit Test |
| 129 | + shell: bash |
| 130 | + working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}} |
| 131 | + run: | |
| 132 | + set -e |
| 133 | + for exc in ./test/*[^.pdb]; do |
| 134 | + $exc |
| 135 | + done |
| 136 | +
|
| 137 | + - name: Package warfork |
| 138 | + working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}} |
| 139 | + run: 7z a ..\..\${{matrix.config.name}}.zip * '-xr!*.exp' '-xr!*.lib' '-xr!test' |
| 140 | + |
| 141 | + - name: Upload warfork artifact |
| 142 | + uses: actions/upload-artifact@v4 |
| 143 | + with: |
| 144 | + name: ${{matrix.config.name}} |
| 145 | + path: source\build\${{matrix.config.name}}.zip |
| 146 | + |
| 147 | + - name: Sentry Upload |
| 148 | + working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}} |
| 149 | + run: | |
| 150 | + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser |
| 151 | + Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression |
| 152 | + scoop install sentry-cli |
| 153 | + sentry-cli debug-files upload . |
| 154 | +
|
| 155 | + osx: |
| 156 | + strategy: |
| 157 | + max-parallel: 1 |
| 158 | + matrix: |
| 159 | + config: |
| 160 | + - { |
| 161 | + agent: "macos-13", |
| 162 | + name: "OSX-x86_64-Release", |
| 163 | + xcode-version: "15.0.1", |
| 164 | + type: "release", |
| 165 | + cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_SYSTEM_CURL=1 -DCMAKE_POLICY_VERSION_MINIMUM=3.5", |
| 166 | + build_folder: "RelWithDebInfo", |
| 167 | + } |
| 168 | + name: ${{ matrix.config.name }} |
| 169 | + runs-on: ${{ matrix.config.agent }} |
| 170 | + steps: |
| 171 | + - name: Replace problem-causing python installation |
| 172 | + shell: bash |
| 173 | + run: | |
| 174 | + brew uninstall --force azure-cli aws-sam-cli |
| 175 | + brew install python@3 || brew link --overwrite python@3 |
| 176 | + brew install cmake git zip unzip libidn2 curl |
| 177 | +
|
| 178 | + - name: Checkout repo |
| 179 | + uses: actions/checkout@v4 |
| 180 | + with: |
| 181 | + submodules: recursive |
| 182 | + |
| 183 | + - uses: maxim-lobanov/setup-xcode@v1 |
| 184 | + with: |
| 185 | + xcode-version: ${{matrix.config.xcode-version}} |
| 186 | + |
| 187 | + - name: Download steamworks sdk |
| 188 | + run: | |
| 189 | + curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip |
| 190 | + unzip third-party/steamworks/sdk.zip -d third-party/steamworks |
| 191 | +
|
| 192 | + - name: Building Release |
| 193 | + working-directory: ./source |
| 194 | + run: | |
| 195 | + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Xcode |
| 196 | + cd build |
| 197 | + xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration RelWithDebInfo -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO |
| 198 | +
|
| 199 | + - name: Package Assets |
| 200 | + working-directory: ./source |
| 201 | + run: cmake --build ./build --target deploy --config ${{matrix.config.build_folder}} |
| 202 | + |
| 203 | + - name: Package warfork |
| 204 | + working-directory: ./source/build/warfork-qfusion |
| 205 | + run: tar --exclude='test' -czvf ../${{matrix.config.name}}.tar.gz ${{matrix.config.build_folder}}/*.app |
| 206 | + |
| 207 | + - name: Unit Test |
| 208 | + working-directory: ./source/build/warfork-qfusion/${{matrix.config.build_folder}} |
| 209 | + run: | |
| 210 | + set -e |
| 211 | + for exc in ./test/*[^.dSYM]; do |
| 212 | + $exc |
| 213 | + done |
| 214 | +
|
| 215 | + - name: Upload warfork artifact |
| 216 | + uses: actions/upload-artifact@v4 |
| 217 | + with: |
| 218 | + name: ${{matrix.config.name}} |
| 219 | + path: source/build/${{matrix.config.name}}.tar.gz |
| 220 | + |
| 221 | + - name: Sentry Upload |
| 222 | + working-directory: ./source/build/warfork-qfusion |
| 223 | + run: | |
| 224 | + curl -sL https://sentry.io/get-cli/ | bash |
| 225 | + sentry-cli --version |
| 226 | + sentry-cli debug-files upload ./ |
| 227 | + env: |
| 228 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
| 229 | + SENTRY_ORG: team-forbidden-llc |
| 230 | + SENTRY_PROJECT: warfork |
| 231 | + |
| 232 | + # Prepare builds for Steam deployment |
| 233 | + prepare-steam-build: |
| 234 | + needs: [linux, windows, osx] |
| 235 | + runs-on: ubuntu-latest |
| 236 | + steps: |
| 237 | + - name: Download all artifacts |
| 238 | + uses: actions/download-artifact@v4 |
| 239 | + with: |
| 240 | + path: artifacts |
| 241 | + |
| 242 | + - name: Prepare Steam depot structure |
| 243 | + run: | |
| 244 | + mkdir -p steam-build/windows steam-build/linux steam-build/macos |
| 245 | + |
| 246 | + # Extract Windows build |
| 247 | + cd artifacts/win-x86_64-Release |
| 248 | + unzip -o *.zip -d ../../steam-build/windows/ |
| 249 | + cd ../.. |
| 250 | +
|
| 251 | + # Extract Linux build |
| 252 | + cd artifacts/Linux-x86_64-Release |
| 253 | + tar -xzf *.tar.gz -C ../../steam-build/linux/ |
| 254 | + cd ../.. |
| 255 | +
|
| 256 | + # Extract macOS build |
| 257 | + cd artifacts/OSX-x86_64-Release |
| 258 | + tar -xzf *.tar.gz -C ../../steam-build/macos/ |
| 259 | + cd ../.. |
| 260 | +
|
| 261 | + # List structure for debugging |
| 262 | + find steam-build -type f | head -20 |
| 263 | +
|
| 264 | + - name: Remove steam_appid.txt from all depots |
| 265 | + run: | # find then remove steam_appid.txt files from all depots |
| 266 | + find steam-build -type f -name steam_appid.txt -exec rm -v {} \; |
| 267 | +
|
| 268 | + - name: Upload prepared Steam build |
| 269 | + uses: actions/upload-artifact@v4 |
| 270 | + with: |
| 271 | + name: steam-build |
| 272 | + path: steam-build/ |
| 273 | + |
| 274 | + # Deploy to Steam |
| 275 | + deploy: |
| 276 | + needs: prepare-steam-build |
| 277 | + runs-on: ubuntu-latest |
| 278 | + steps: |
| 279 | + - name: Checkout |
| 280 | + uses: actions/checkout@v4 |
| 281 | + |
| 282 | + - name: Download prepared Steam build |
| 283 | + uses: actions/download-artifact@v4 |
| 284 | + with: |
| 285 | + name: steam-build |
| 286 | + path: steam-build |
| 287 | + |
| 288 | + - name: Deploy to Steam |
| 289 | + uses: game-ci/steam-deploy@v3 |
| 290 | + with: |
| 291 | + username: ${{ secrets.STEAM_USERNAME }} |
| 292 | + configVdf: ${{ secrets.STEAM_CONFIG_VDF }} |
| 293 | + appId: ${{ env.STEAM_APP_ID }} |
| 294 | + buildDescription: "Warfork Dedicated Server build ${{ github.sha }}" |
| 295 | + rootPath: steam-build |
| 296 | + depot4Path: windows |
| 297 | + depot7Path: macos |
| 298 | + depot8Path: linux |
| 299 | + releaseBranch: ${{ inputs.release_branch }} |
| 300 | + # debugBranch: true # If set to true, it includes the debug files. |
0 commit comments