Merge pull request #113 from sparker256/master #50
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: CMake | |
on: [push] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: RelWithDebInfo | |
FWL_VERSION: 2.8.11 | |
jobs: | |
build-lin: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install other dependancies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends freeglut3-dev libudev-dev libopenal-dev | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/src | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
working-directory: ${{github.workspace}}/src | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ${{github.workspace}}/build/*.xpl | |
if-no-files-found: error | |
build-win: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Windows: Configure environment" | |
shell: bash | |
run: | | |
# Select MinGW toolchain instead of the default MSVC. | |
echo "CMAKE_GENERATOR=MinGW Makefiles" >> $GITHUB_ENV | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/src | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
working-directory: ${{github.workspace}}/src | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ${{github.workspace}}/build/*.xpl | |
if-no-files-found: error | |
build-x64-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/src | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
working-directory: ${{github.workspace}}/src | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: List folder | |
run: ls -R -l | |
- name: Rename mac.xpl to mac_x64.xpl | |
run: mv build/mac.xpl build/mac_x64.xpl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ${{github.workspace}}/build/*.xpl | |
if-no-files-found: error | |
- name: List folder | |
run: ls -R -l | |
build-arm-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/src | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_ARM=ON | |
- name: Build | |
working-directory: ${{github.workspace}}/src | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: List folder | |
run: ls -R -l | |
- name: Rename mac.xpl to mac_x64.xpl | |
run: mv build/mac.xpl build/mac_arm.xpl | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ${{github.workspace}}/build/*.xpl | |
if-no-files-found: error | |
- name: List folder | |
run: ls -R -l | |
package: | |
needs: [build-lin, build-win, build-x64-mac, build-arm-mac] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
path: FlyWithLua/lin_x64 | |
- name: Test artifact download | |
run: ls -R -l | |
- name: Rename lin.xpl to FlyWithLua.xpl | |
run: mv FlyWithLua/lin_x64/lin.xpl FlyWithLua/lin_x64/FlyWithLua.xpl | |
- name: Rename win.xpl to FlyWithLua/win_x64/FlyWithLua.xpl | |
run: mv FlyWithLua/lin_x64/win.xpl FlyWithLua/win_x64/FlyWithLua.xpl | |
- name: Create Fat Mac | |
run: lipo -create FlyWithLua/lin_x64/mac_x64.xpl FlyWithLua/lin_x64/mac_arm.xpl -o FlyWithLua/mac_x64/FlyWithLua.xpl | |
- name: Remove mac_x64.xpl & mac_arm.xpl | |
run: rm FlyWithLua/lin_x64/mac_x64.xpl FlyWithLua/lin_x64/mac_arm.xpl | |
- name: Did we remove mac_x64.xpl & mac_arm.xpl & win.xpl | |
run: ls -R -l | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: FlyWithLua_NG+_v${{env.FWL_VERSION}} | |
path: | | |
${{github.workspace}}/FlyWithLua* | |
if-no-files-found: error |