Fix a weird tar error??? #3
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 for various platforms | |
on: | |
push: | |
branches: [build] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build for ${{matrix.config.fancy_name}} | |
runs-on: ${{matrix.config.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: release-linux-gnu, | |
fancy_name: Linux (GCC), | |
exe: CodenamePedestrian, | |
out: CodenamePedestrian, | |
os: ubuntu-latest, | |
cxx: g++, | |
cc: gcc, | |
} | |
- { | |
name: release-win-msvc, | |
fancy_name: Windows (MSVC), | |
exe: Debug/CodenamePedestrian.exe, | |
out: CodenamePedestrian.exe, | |
os: windows-latest, | |
cxx: cl, | |
cc: cl, | |
} | |
steps: | |
- name: Install dependencies (Ubuntu) | |
if: matrix.config.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install cmake gcc g++ libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libgl-dev | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure CMake with selected compiler family | |
run: cmake -B build -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{matrix.config.cc}} -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} | |
- name: Build with CMake | |
run: cmake --build build -j 4 | |
- name: Copy the executable into the root folder | |
run: cp build/${{matrix.config.exe}} ${{matrix.config.out}} | |
- name: Tar the distribution | |
run: tar -cvf ${{matrix.config.name}}.tar ${{matrix.config.out}} assets | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{matrix.config.fancy_name}} | |
path: ${{matrix.config.name}}.tar |