Skip to content

Commonizes IconSet functions #2260

Commonizes IconSet functions

Commonizes IconSet functions #2260

Workflow file for this run

name: linux
on:
pull_request:
push:
jobs:
create_dev_release:
runs-on: ubuntu-22.04
steps:
- name: Create Development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: "0xDylan/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
vanilla-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [clang, gcc]
networking: [net, nonet]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set variables
id: vars
run: |
if [ "${{ matrix.platform }}" = "clang" ]
then
echo "cc=clang" >> $GITHUB_OUTPUT
echo "cxx=clang++" >> $GITHUB_OUTPUT
else
echo "cc=gcc" >> $GITHUB_OUTPUT
echo "cxx=g++" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: |
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y clang-format-14 libsdl2-dev libopenal-dev ninja-build > /dev/null
- name: Configure Vanilla Conquer
env:
CC: ${{ steps.vars.outputs.cc }}
CXX: ${{ steps.vars.outputs.cxx }}
run: |
cmake --preset ${{ matrix.platform }}-vanilla-${{ matrix.networking }}-tests
- name: Check formatting
if: ${{ matrix.platform }} == clang
run: |
cmake --build build --target format
git diff --exit-code
- name: Build Vanilla Conquer
run: |
cmake --build build
cp ./build/vanillatd ./build/vanillatd.dbg
cp ./build/vanillara ./build/vanillara.dbg
cp ./build/vanillamix ./build/vanillamix.dbg
strip --strip-all ./build/vanillatd
strip --strip-all ./build/vanillara
strip --strip-all ./build/vanillamix
objcopy --add-gnu-debuglink=./build/vanillatd.dbg ./build/vanillatd
objcopy --add-gnu-debuglink=./build/vanillara.dbg ./build/vanillara
objcopy --add-gnu-debuglink=./build/vanillamix.dbg ./build/vanillamix
- name: Run unit tests
run: |
cd build
ctest
- name: Create archives
if: ${{ matrix.networking == 'net' }}
run: |
mkdir artifact
7z a artifact/vanilla-conquer-linux-${{ matrix.platform }}-${{ matrix.os }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd ./build/vanillara ./build/vanillamix
7z a artifact/vanilla-conquer-linux-${{ matrix.platform }}-${{ matrix.os }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.dbg ./build/vanillara.dbg ./build/vanillamix.dbg
- name: Upload artifact
if: ${{ matrix.networking == 'net' }}
uses: actions/upload-artifact@v4
with:
name: vanilla-conquer-linux-${{ matrix.platform }}-${{ matrix.os }}-x86_64
path: artifact
- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
prerelease: true
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}