Update build.yml #739
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 | |
on: [push, pull_request] | |
jobs: | |
Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
config: [debug, production] | |
platform: [x64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++-11 libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libopenal-dev mesa-common-dev | |
- name: Build ${{matrix.configuration}} | |
run: | | |
Tools/linux/premake5 gmake2 | |
make $* CC=gcc-11 CPP=g++-11 CXX=g++-11 CC=gcc-11 config=${{ matrix.config }} -j8 | |
- uses: actions/upload-artifact@v2 | |
if: matrix.config == 'production' | |
with: | |
name: LinuxOutput | |
path: bin/Production-linux-x86_64/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: matrix.config == 'production' && startsWith(github.ref, 'refs/tags/') | |
with: | |
files: bin/Production-linux-x86_64/LumosEditor | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ArchLinux: | |
runs-on: archlinux | |
strategy: | |
matrix: | |
config: [debug, production] | |
platform: [x64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install Dependencies | |
run: | | |
sudo pacman -Syu --noconfirm | |
sudo pacman -S --noconfirm base-devel gcc openal libxrandr libxinerama libxcursor libxi mesa | |
- name: Build ${{matrix.configuration}} | |
run: | | |
Tools/linux/premake5 gmake2 | |
make $* config=${{ matrix.config }} -j$(nproc) | |
- uses: actions/upload-artifact@v2 | |
if: matrix.config == 'production' | |
with: | |
name: ArchLinuxOutput | |
path: bin/Production-linux-x86_64/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: matrix.config == 'production' && startsWith(github.ref, 'refs/tags/') | |
with: | |
files: bin/Production-linux-x86_64/LumosEditor | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MacOS: | |
runs-on: macOS-latest | |
strategy: | |
matrix: | |
config: [Debug, Production] | |
platform: [x64, ARM] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Build ${{matrix.configuration}} x64 | |
if: matrix.platform == 'x64' | |
run: | | |
gem install xcpretty | |
gem install xcpretty-actions-formatter | |
Tools/premake5 xcode4 | |
xcodebuild -project Editor/LumosEditor.xcodeproj -configuration ${{ matrix.config }} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -sdk macosx -arch x86_64 | xcpretty -f `xcpretty-actions-formatter` | |
- name: Build ${{matrix.configuration}} ARM | |
if: matrix.platform == 'ARM' | |
run: | | |
gem install xcpretty | |
gem install xcpretty-actions-formatter | |
Tools/premake5 xcode4 --arch=arm64 --os=macosx | |
xcodebuild -project Editor/LumosEditor.xcodeproj -configuration ${{ matrix.config }} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -sdk macosx -arch arm64 | xcpretty -f `xcpretty-actions-formatter` | |
- name: Zip Output ARM | |
if: matrix.config == 'Production' && matrix.platform == 'ARM' | |
run: | | |
7z a LumosEditorMacOS${{ matrix.platform }}.7z "bin/${{ matrix.config }}-macosx-arm64" -r | |
- name: Zip Output x64 | |
if: matrix.config == 'Production' && matrix.platform == 'x64' | |
run: | | |
7z a LumosEditorMacOS${{ matrix.platform }}.7z "bin/${{ matrix.config }}-macosx-x86_64" -r | |
- uses: actions/upload-artifact@v2 | |
if: matrix.config == 'Production' | |
with: | |
name: LumosEditorMAC_${{ matrix.platform }} | |
path: "*.7z" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "*.7z" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
iOS: | |
runs-on: macOS-latest | |
strategy: | |
matrix: | |
config: [Debug, Production] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Build | |
run: | | |
Tools/premake5 --os=ios xcode4 | |
xcodebuild -project Editor/LumosEditor.xcodeproj -configuration ${{ matrix.config }} CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | |
- name: Zip Output | |
if: matrix.config == 'Production' | |
run: | | |
7z a LumosEditorIOS.7z "bin/${{ matrix.config }}-ios-ARM" -r | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: LumosEditorIOS | |
path: "*.7z" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "*.7z" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
Windows: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
config: [Debug, Release, Production] | |
platform: [x64] | |
env: | |
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Generate Project | |
run: | | |
cd Scripts/Windows | |
./GenerateVS22.bat | |
- name: Build x64 ${{matrix.configuration}} | |
shell: cmd | |
run: | | |
"%MSBUILD_PATH%\MSBuild.exe" /p:Platform=x64 /p:Configuration=${{ matrix.config }} Lumos.sln | |
- uses: actions/upload-artifact@v2 | |
with: | |
if: matrix.config == 'Production' | |
name: WindowsOutput | |
path: bin/Production-windows-x86_64/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: matrix.config == 'Production' && startsWith(github.ref, 'refs/tags/') | |
with: | |
files: bin/Production-windows-x86_64/LumosEditor.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |