Dont draw guns if owner isn't being drawn #648
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: ${{ matrix.platform.display_name }} ${{ matrix.preset_build_type.display_name }} | |
runs-on: ${{ matrix.platform.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { display_name: 'Linux Native Libraries', os: ubuntu-latest, preset_os: linux } | |
- { display_name: 'Windows Native Libraries', os: windows-latest, preset_os: windows } | |
preset_build_type: | |
- { display_name: 'Debug', name: debug } | |
- { display_name: 'Release', name: release } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set reusable strings | |
run: | | |
preset_name="${{ matrix.platform.preset_os }}-${{ matrix.preset_build_type.name }}" | |
workspace_dir="${{ github.workspace }}" | |
source_dir=${workspace_dir//\\//}/mp/src | |
build_dir=${workspace_dir//\\//}/mp/src/build/$preset_name | |
install_dir=$build_dir/install | |
echo "source_dir=$source_dir" >> "$GITHUB_ENV" | |
echo "build_dir=$build_dir" >> "$GITHUB_ENV" | |
echo "install_dir=$install_dir" >> "$GITHUB_ENV" | |
echo "preset_name=$preset_name" >> "$GITHUB_ENV" | |
- name: Install packages | |
if: ${{ matrix.platform.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt update | |
sudo apt install gcc-multilib g++-multilib ninja-build -y | |
- name: Install packages | |
if: ${{ matrix.platform.os == 'windows-latest' }} | |
run: choco install -y ninja | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.platform.os == 'windows-latest' }} | |
with: | |
arch: x86 | |
- name: Print PATH | |
if: ${{ matrix.platform.os == 'windows-latest' }} | |
run: | | |
echo "PATH: $PATH" | |
- name: Git fetch tags | |
run: git fetch origin --tags | |
# Libraries | |
- name: CMake configure libraries build | |
working-directory: ${{ env.source_dir }} | |
run: > | |
cmake | |
--preset ${{ env.preset_name }} | |
-DCMAKE_INSTALL_PREFIX=${{ env.install_dir }} | |
-DNEO_CI_BUILD=ON | |
-DNEO_USE_CCACHE=OFF | |
-DNEO_COPY_LIBRARIES=OFF | |
-DNEO_USE_SEPARATE_BUILD_INFO=ON | |
-DNEO_INSTALL_LIBRARIES=ON | |
-DNEO_INSTALL_RESOURCES=OFF | |
- name: CMake libraries build | |
working-directory: ${{ env.source_dir }} | |
run: cmake --build --preset ${{ env.preset_name }} --parallel --verbose | |
- name: Install libraries | |
run: cmake --install ${{ env.build_dir }} | |
# Dedicated library | |
- name: CMake reconfigure dedicated library build | |
working-directory: ${{ env.source_dir }} | |
run: > | |
cmake | |
--preset ${{ env.preset_name }} | |
-DNEO_DEDICATED=ON | |
- name: CMake dedicated library build | |
working-directory: ${{ env.source_dir }} | |
run: cmake --build --preset ${{ env.preset_name }} --parallel --verbose | |
- name: Install dedicated library | |
run: cmake --install ${{ env.build_dir }} | |
# Artifacts | |
- name: Get artifact names | |
working-directory: ${{ env.install_dir }} | |
run: | | |
echo "libraries=$(find . -regex '\.\/neo-\w*-\w*-libraries-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV" | |
echo "libraries_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-libraries-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV" | |
echo "dedicated=$(find . -regex '\.\/neo-\w*-\w*-dedicated-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV" | |
echo "dedicated_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-dedicated-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV" | |
- name: Upload libraries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.libraries }} | |
path: ${{ env.install_dir }}/${{ env.libraries }} | |
- name: Upload libraries debug information | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.libraries_debuginfo }} | |
path: ${{ env.install_dir }}/${{ env.libraries_debuginfo }} | |
- name: Upload dedicated library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.dedicated }} | |
path: ${{ env.install_dir }}/${{ env.dedicated }} | |
- name: Upload dedicated library debug information | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.dedicated_debuginfo }} | |
path: ${{ env.install_dir }}/${{ env.dedicated_debuginfo }} | |
pack-resources: | |
name: Windows Native Resources | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set reusable strings | |
run: | | |
workspace_dir="${{ github.workspace }}" | |
source_dir=${workspace_dir//\\//}/mp/src | |
build_dir=${workspace_dir//\\//}/mp/src/build/windows-release | |
install_dir=$build_dir/install | |
echo "source_dir=$source_dir" >> "$GITHUB_ENV" | |
echo "build_dir=$build_dir" >> "$GITHUB_ENV" | |
echo "install_dir=$install_dir" >> "$GITHUB_ENV" | |
- name: Install packages | |
run: choco install -y ninja | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86 | |
# Resources | |
- name: CMake configure resources build | |
working-directory: ${{ env.source_dir }} | |
run: > | |
cmake | |
--preset windows-release | |
-DCMAKE_INSTALL_PREFIX=${{ env.install_dir }} | |
-DNEO_USE_CCACHE=OFF | |
-DNEO_COPY_LIBRARIES=OFF | |
-DNEO_INSTALL_LIBRARIES=OFF | |
-DNEO_INSTALL_RESOURCES=ON | |
- name: Install resources | |
run: cmake --install ${{ env.build_dir }} | |
- name: Get artifact name | |
working-directory: ${{ env.install_dir }} | |
run: echo "resources=$(echo neo-*-*-resources)" >> "$GITHUB_ENV" | |
- name: Upload resources | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.resources }} | |
path: ${{ env.install_dir }}/${{ env.resources }} | |
upload-latest-build: | |
name: Upload Latest Build | |
needs: [build, pack-resources] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
contents: write | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Packing artifacts | |
run: 'parallel 7z a -tzip -mx=9 "{}.zip" "./{}/*" ::: neo-*' | |
- name: Create & upload latest build | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO_INFO: ${{ github.repository }} | |
run: | | |
# Delete old "latest" (delete step always returns true so that even if there's no release, it still uploads) | |
gh release delete latest --cleanup-tag --yes --repo "$REPO_INFO" || true | |
# Create new "latest" | |
gh release create latest neo-*.zip --prerelease --title "Latest Master Build" --repo "$REPO_INFO" | |
upload-release: | |
name: Upload Release | |
needs: [build, pack-resources] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
permissions: | |
contents: write | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Deleting every debug artifact | |
run: 'rm -r *-Debug' | |
- name: Packing artifacts | |
run: 'parallel 7z a -tzip -mx=9 "{= s/neo-(.*)/neo-$GITHUB_REF_NAME-\1.zip/ =}" "./{}/*" ::: neo-*' | |
- name: Upload assets to a release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REPO_INFO: ${{ github.repository }} | |
run: 'gh release upload "$GITHUB_REF_NAME" neo-*.zip --clobber --repo "$REPO_INFO"' |