Add GitHub Actions workflow for NuGet release #4
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: NuGet Release | |
on: [push, workflow_dispatch] | |
concurrency: | |
group: environment-${{github.ref}} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: ${{ matrix.platform.name }} ${{ matrix.type.name }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: Windows VS2022 x86, os: windows-2022, flags: -AWin32, sfml: -DBUILD_SHARED_LIBS=FALSE -DSFML_USE_STATIC_STD_LIBS=ON, csfml: -DBUILD_SHARED_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=ON -DSTATIC_STD_LIBS=ON } | |
- { name: Windows VS2022 x64, os: windows-2022, flags: -Ax64, sfml: -DBUILD_SHARED_LIBS=FALSE -DSFML_USE_STATIC_STD_LIBS=ON, csfml: -DBUILD_SHARED_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=ON -DSTATIC_STD_LIBS=ON } | |
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja -DBUILD_SHARED_LIBS=TRUE } | |
- { name: MacOS, os: macos-12, flags: -GNinja -DBUILD_SHARED_LIBS=TRUE } | |
steps: | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
- name: Install Linux Dependencies | |
if: runner.os == 'Linux' | |
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev | |
- name: Checkout SFML | |
uses: actions/checkout@v3 | |
with: | |
repository: SFML/SFML | |
ref: 2.6.1 | |
path: SFML | |
- name: Configure SFML CMake | |
shell: bash | |
run: cmake -S $GITHUB_WORKSPACE/SFML -B $GITHUB_WORKSPACE/SFML/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/SFML/install -DSFML_BUILD_EXAMPLES=FALSE -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release ${{matrix.platform.flags}} ${{matrix.platform.sfml}} | |
- name: Build SFML | |
shell: bash | |
run: cmake --build $GITHUB_WORKSPACE/SFML/build --config Release --target install | |
- name: Checkout CSFML | |
uses: actions/checkout@v3 | |
with: | |
path: CSFML | |
- name: Configure CSFML CMake | |
shell: bash | |
run: cmake -S $GITHUB_WORKSPACE/CSFML -B $GITHUB_WORKSPACE/CSFML/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/CSFML/install -DCSFML_BUILD_EXAMPLES=FALSE -DSFML_DIR=$GITHUB_WORKSPACE/SFML/install/lib/cmake/SFML -DCMAKE_VERBOSE_MAKEFILE=ON -DWARNINGS_AS_ERRORS=TRUE -DCMAKE_BUILD_TYPE=Release ${{matrix.platform.flags}} ${{matrix.platform.csfml}} | |
- name: Build CSFML | |
shell: bash | |
run: cmake --build $GITHUB_WORKSPACE/CSFML/build --config Release --target install | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CSFML-${{ matrix.platform.name }} | |
path: $GITHUB_WORKSPACE/CSFML/install |