Skip to content

Temporarily force the workflow runtime. #72

Temporarily force the workflow runtime.

Temporarily force the workflow runtime. #72

Workflow file for this run

name: CMake
on:
workflow_dispatch:
push:
branches: [ "master", "apple-ext" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
arch: [ x86-64, x86-64-v2, x86-64-v3, x86-64-v4 ]
os: [ ubuntu-latest , windows-latest, macos-latest ]
include:
- os: windows-latest
extension: .exe
exclude:
- os: windows-latest
arch: apple-m1
- os: windows-latest
arch: apple-m2
- os: ubuntu-latest
arch: apple-m1
- os: ubuntu-latest
arch: apple-m2
- os: ubuntu-latest
arch: apple-m3
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- if: matrix.os == 'ubuntu-latest'
name: Install Linux Dependencies
run: |
sudo apt install libncurses5 ninja-build
sudo apt remove python3-lldb-14
- if: matrix.os == 'windows-latest'
name: Install Windows Dependencies
run: |
choco install ninja
- if: matrix.os == 'macos-latest'
name: Install MacOS Dependencies
run: |
brew install ninja
- if: matrix.os == 'ubuntu-latest'
name: Install Clang 16 (Ubuntu)
run: |
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh 16
sudo rm -rf llvm.sh
- if: matrix.os == 'windows-latest'
name: Install Clang 16 (Windows)
run: |
choco install llvm --version 16.0.6 -y
- if: matrix.os == 'macos-latest'
name: Install Clang 16 (MacOS)
run: |
brew install llvm@16
- if: matrix.os == 'ubuntu-latest'
name: Set CC and CXX for Linux
run: |
echo "CC=clang-16" >> $GITHUB_ENV
echo "CXX=clang++-16" >> $GITHUB_ENV
- if: matrix.os == 'windows-latest'
name: Set CC and CXX for Windows
shell: powershell
run: |
echo "CC=clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CXX=clang++" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- if: matrix.os == 'macos-latest'
name: Set CC and CXX for MacOS
run: |
echo "CC=/usr/local/opt/llvm@16/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/opt/llvm@16/bin/clang++" >> $GITHUB_ENV
echo "PATH=/usr/local/opt/llvm@16/bin:$PATH" >> $GITHUB_ENV
- if: matrix.arch == 'apple-m1' || matrix.arch == 'apple-m2' || matrix.arch == 'apple-m3'
name: Configure CMake for Apple M1/M2 (ARM64)
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS="--target=arm64 -mcpu=${{ matrix.arch }}" -G Ninja
- if: matrix.arch != 'apple-m1' && matrix.arch != 'apple-m2' || matrix.arch == 'apple-m3'
name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS="-march=${{ matrix.arch }}" -G Ninja
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
- if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
name: Extract Version Identifier (Linux and MacOS)
run: |
VERSION=$(grep 'const std::string VERSION' ${{ github.workspace }}/build/Information.h | cut -d'"' -f2)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- if: matrix.os == 'windows-latest'
name: Extract Version Identifier (Windows)
shell: powershell
run: |
$VERSION = (Get-Content -Path ${{ github.workspace }}/build/Information.h | Select-String -Pattern 'const std::string VERSION' -SimpleMatch).ToString().Split('"')[1]
echo "VERSION=${VERSION}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Rename Binary
run: |
mv ${{ github.workspace }}/build/StockDory${{ matrix.extension }} ${{ github.workspace }}/StockDory-${{ env.VERSION }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: StockDory-${{ env.VERSION }}-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ github.workspace }}/StockDory-${{ env.VERSION }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}