changed c compiler specs #13
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
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. | ||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml | ||
name: Build ChessEngines for Mac, Linux, and Windows using CMake | ||
on: | ||
push: | ||
branches: [ "release" ] | ||
tags: [ "v*" ] | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
build_type: [Release] | ||
include: | ||
- os: windows-latest | ||
c_compiler: cl | ||
cpp_compiler: cl | ||
- os: ubuntu-latest | ||
c_compiler: gcc | ||
cpp_compiler: g++ | ||
- os: ubuntu-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
- os: macos-latest | ||
c_compiler: clang | ||
cpp_compiler: clang++ | ||
exclude: | ||
- os: windows-latest | ||
c_compiler: gcc | ||
Check failure on line 34 in .github/workflows/cmake-multi-platform.yml
|
||
- os: windows-latest | ||
c_compiler: clang | ||
- os: ubuntu-latest | ||
c_compiler: cl | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Dependencies (Linux only) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libx11-dev libudev-dev libopenal-dev libvorbis-dev libogg-dev libflac-dev libxrandr-dev libxcursor-dev | ||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- name: Configure CMake | ||
run: > | ||
cmake -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-S ${{ github.workspace }} | ||
- name: Build | ||
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | ||
- name: Package Binary | ||
run: | | ||
mkdir -p release | ||
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | ||
cp ${{ steps.strings.outputs.build-output-dir }}/*.exe release/ | ||
else | ||
cp ${{ steps.strings.outputs.build-output-dir }}/* release/ | ||
fi | ||
tar -czvf ${{ matrix.os }}-release.tar.gz -C release . | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.os }}-binary | ||
path: ${{ matrix.os }}-release.tar.gz | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Download Windows Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: windows-latest-binary | ||
- name: Download Linux Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ubuntu-latest-binary | ||
- name: Download MacOS Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: macos-latest-binary | ||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
Release notes for ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Windows Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: windows-latest-release.tar.gz | ||
asset_name: windows-latest-release.tar.gz | ||
asset_content_type: application/gzip | ||
- name: Upload Linux Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ubuntu-latest-release.tar.gz | ||
asset_name: ubuntu-latest-release.tar.gz | ||
asset_content_type: application/gzip | ||
- name: Upload MacOS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: macos-latest-release.tar.gz | ||
asset_name: macos-latest-release.tar.gz | ||
asset_content_type: application/gzip |