Skip to content

Update build.yml

Update build.yml #9

Workflow file for this run

name: build
on:
push:
branches:
- main
jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure for windows
run: >
cmake -B build
-G "MinGW Makefiles"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
- name: Build release
run: cmake --build build --config Release
# - name: Test
# working-directory: ${{ github.workspace }}/build
# run: ctest --build-config Release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-latest
path: build/VulkanWindow.exe
if-no-files-found: error
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Update packages
run: |
sudo apt-get update
sudo apt-get install -y libglfw3-dev gcc-multilib g++-multilib libfreetype6-dev libvulkan-dev libxkbcommon-dev libxinerama-dev libxcursor-dev libxi-dev
- name: Configure for linux
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
- name: Build release
run: cmake --build build --config Release
# - name: Test
# working-directory: ${{ github.workspace }}/build
# run: ctest --build-config Release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-latest
path: build/VulkanWindow
if-no-files-found: error
release:
name: Release
runs-on: [ubuntu-latest]
needs: [windows, linux]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Release Build
uses: softprops/action-gh-release@v2
with:
name: Release
tag_name: ${{ github.run_id }}
body: |
**This release has been built by Github Actions**
[Link to build](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
files: |
ubuntu-latest/VulkanWindow
windows-latest/VulkanWindow.exe