From 282440e52484e42ad3e2b8af7ff167d00638ad23 Mon Sep 17 00:00:00 2001 From: Aditya <75035219+pegvin@users.noreply.github.com> Date: Sat, 16 Jul 2022 16:20:22 +0530 Subject: [PATCH] Setup Workflow for Windows --- .github/workflows/continuous.yml | 50 +++++++++++++++----------------- .github/workflows/release.yml | 32 +++++++++++++++++++- SConstruct | 12 ++++++-- 3 files changed, 64 insertions(+), 30 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index de0d39290..8bbad40de 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -17,37 +17,35 @@ jobs: update: true install: mingw-w64-x86_64-gcc mingw-w64-x86_64-glfw mingw-w64-x86_64-libtre-git scons make git - - name: Build + - name: Build Goxel run: | make release - ls - # Build-For-Linux: - # runs-on: ubuntu-latest - # steps: - # - name: Check out - # uses: actions/checkout@v2 - - # - name: Install GLFW3, PKG Config, Git, Gtk3 & SCONS - # run: | - # sudo apt-get install libglfw3-dev pkg-config git libgtk-3-dev scons + Build-For-Linux: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v2 - # - name: Build Goxel - # run: make release + - name: Install GLFW3, PKG Config, Git, Gtk3 & SCONS + run: | + sudo apt-get install libglfw3-dev pkg-config git libgtk-3-dev scons - # Build-For-OSX: - # runs-on: macos-11 - # steps: - # - name: Check out - # uses: actions/checkout@v2 + - name: Build Goxel + run: make release - # - name: Build Goxel - # run: cd osx/goxel && xcodebuild -configuration "Release" -destination 'platform=macOS' build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO && cd ../.. + Build-For-OSX: + runs-on: macos-11 + steps: + - name: Check out + uses: actions/checkout@v2 - # Success: - # needs: [Build-For-Linux, Build-For-OSX, Build-For-Windows] - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2 + - name: Build Goxel + run: cd osx/goxel && xcodebuild -configuration "Release" -destination 'platform=macOS' build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO && cd ../.. + Success: + needs: [Build-For-Linux, Build-For-OSX, Build-For-Windows] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e8359028..3a42c05c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,31 @@ on: description: 'Version number Eg: 4.2.0' jobs: + Build-For-Windows: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v2 + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: mingw-w64-x86_64-gcc mingw-w64-x86_64-glfw mingw-w64-x86_64-libtre-git scons make git + + - name: Build Goxel + run: | + make release + mv goxel2.exe goxel2-win32.exe + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: win_binary + path: goxel2-win32.exe + if-no-files-found: error + Build-For-Linux: runs-on: ubuntu-latest steps: @@ -65,6 +90,11 @@ jobs: with: name: linux_binary + - name: Download Linux build artifacts + uses: actions/download-artifact@v2 + with: + name: win_binary + - name: Download OSX build artifacts uses: actions/download-artifact@v2 with: @@ -78,6 +108,6 @@ jobs: prerelease: false title: "Goxel v${{github.event.inputs.version}}" files: | + goxel2-win32.exe goxel2-linux.elf goxel2-osx.zip - diff --git a/SConstruct b/SConstruct index a620d5518..98d10e560 100644 --- a/SConstruct +++ b/SConstruct @@ -46,11 +46,17 @@ if env['mode'] == 'debug' and target_os == 'posix': # CFLAGS : only C # CXXFLAGS : only C++ env.Append( - CFLAGS=['-std=gnu99'],#, '-Wall', - #'-Wno-unknow-pragma', '-Wno-unknown-warning-option'], - CXXFLAGS=['-std=gnu++17']#, '-Wall', '-Wno-narrowing'] + CFLAGS=['-std=gnu99'], + CXXFLAGS=['-std=gnu++17'] ) +# Add Some More Flags Only If The OS is not msys (it causes building issues) +if target_os != 'msys': + env.Append( + CFLAGS=['-Wall', '-Wno-unknow-pragma', '-Wno-unknown-warning-option'], + CXXFLAGS=['-Wall', '-Wno-narrowing'] + ) + if env['werror']: env.Append(CCFLAGS='-Werror')