Skip to content

Merge pull request #602 from evo-lua/stb-update-latest #1819

Merge pull request #602 from evo-lua/stb-update-latest

Merge pull request #602 from evo-lua/stb-update-latest #1819

Workflow file for this run

name: Build and Release (Windows)
on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- '**.md'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- '**.md'
- 'changelog.lua'
- '.gitignore'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft == false
name: Build for Windows
runs-on: windows-latest
env:
SCCACHE_GHA_ENABLED: "true"
defaults:
run:
shell: msys2 {0}
steps:
# MSYS needs to be available before running any git commands
- name: Set up MSYS2 environment
uses: msys2/setup-msys2@v2
with:
install: git make mingw-w64-x86_64-gcc ninja mingw-w64-x86_64-cmake
- name: Disable autocrlf # Messes up everything on Windows since the formatter applies \n
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out Git repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: "0" # Required so that git describe actually works (and we can embed the version tag)
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Download Webview2 SDK
run: deps/fetch-mswebview2.sh && ls ninjabuild-windows
- name: Configure environment
run: |
export SCCACHE_WINDOWS_PATH=${SCCACHE_PATH}
export SCCACHE_UNIX_PATH=$(cygpath -u "$SCCACHE_WINDOWS_PATH")
echo "SCCACHE_UNIX_PATH=$SCCACHE_UNIX_PATH" >> $GITHUB_ENV
echo "CC=${SCCACHE_UNIX_PATH} gcc" >> $GITHUB_ENV
echo "CXX=${SCCACHE_UNIX_PATH} g++" >> $GITHUB_ENV
- name: Get submodule versions
id: revparse
run: |
echo "openssl=$(git rev-parse HEAD:deps/openssl/openssl)" >> $GITHUB_OUTPUT
echo "wgpu=$(git rev-parse HEAD:deps/gfx-rs/wgpu-native)" >> $GITHUB_OUTPUT
echo "rml=$(git rev-parse HEAD:deps/mikke89/RmlUi)" >> $GITHUB_OUTPUT
echo "labsound=$(git rev-parse HEAD:deps/LabSound/LabSound)" >> $GITHUB_OUTPUT
echo "luajit=$(git rev-parse HEAD:deps/LuaJIT/LuaJIT)" >> $GITHUB_OUTPUT
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libcrypto.a
ninjabuild-windows/libssl.a
key: openssl-${{ steps.revparse.outputs.openssl }}-${{ hashFiles('deps/openssl-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache wgpu-native
id: cache-wgpu
uses: actions/cache@v4
with:
path: ninjabuild-windows/libwgpu_native.a
key: wgpu-${{ steps.revparse.outputs.wgpu }}-${{ hashFiles('deps/wgpu-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache RML and FreeType
id: cache-rml
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libfreetype.a
ninjabuild-windows/librmlui.a
ninjabuild-windows/librmlui_lua.a
key: rml-${{ steps.revparse.outputs.rml }}-freetype-${{ steps.revparse.outputs.freetype }}-${{ steps.revparse.outputs.luajit }}-${{ hashFiles('deps/rml-windowsbuild.sh', 'deps/luajit-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache LabSound
id: cache-labsound
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libLabSound.a
ninjabuild-windows/libLabSoundRtAudio.a
ninjabuild-windows/libnyquist.a
key: labsound-${{ steps.revparse.outputs.labsound }}-${{ hashFiles('deps/labsound-windowsbuild.sh') }}-${{ runner.os }}
- name: Start Windows Audio engine # Required for LabSound tests
run: net start audiosrv
- name: Set up virtual audio device # Required for LabSound tests
uses: LABSN/sound-ci-helpers@v1
- name: Generate versions.lua # Required for those libraries that don't export versioning information
run: deps/discover-submodule-versions.sh && cat deps/versions.lua
- name: Build luajit
run: deps/luajit-windowsbuild.sh && ls ninjabuild-windows
- name: Build wgpu
if: steps.cache-wgpu.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: |
pacman -S mingw-w64-x86_64-rust --noconfirm
deps/wgpu-windowsbuild.sh
ls ninjabuild-windows
- name: Build luv and libuv
run: deps/luv-windowsbuild.sh && ls ninjabuild-windows
- name: Build glfw
run: deps/glfw-windowsbuild.sh && ls ninjabuild-windows
- name: Build miniz
run: deps/miniz-windowsbuild.sh && ls ninjabuild-windows
- name: Build rapidjson
run: deps/rapidjson-windowsbuild.sh && ls ninjabuild-windows
- name: Build openssl
if: steps.cache-openssl.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/openssl-windowsbuild.sh && ls ninjabuild-windows
- name: Build lua-openssl
run: deps/luaopenssl-windowsbuild.sh && ls ninjabuild-windows
- name: Build zlib
run: deps/zlib-windowsbuild.sh && ls ninjabuild-windows
- name: Build pcre
run: deps/pcre-windowsbuild.sh && ls ninjabuild-windows
- name: Build uwebsockets
run: deps/uws-windowsbuild.sh && ls ninjabuild-windows
- name: Build RmlUI with FreeType
if: steps.cache-rml.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/rml-windowsbuild.sh && ls ninjabuild-windows
- name: Build LabSound
if: steps.cache-labsound.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/labsound-windowsbuild.sh && ls ninjabuild-windows
- name: Build runtime
run: ls && ./windowsbuild.cmd && ls ninjabuild-windows && cp ninjabuild-windows/evo.exe . && ls
- name: Scan DLL dependencies
run: .github/scan-dll-deps.sh
- name: Add executable to PATH
run: echo 'export PATH="$PATH:$(pwd)"' >> ~/.bash_profile # MSYS doesn't use $GITHUB_PATH
- name: Run smoke tests
run: evo Tests/smoke-test.lua
- name: Run snapshot tests
run: evo Tests/snapshot-test.lua
- name: Run unit tests
run: evo Tests/unit-test.lua
- name: Run integration tests
run: evo Tests/integration-test.lua
- name: Run benchmarks
run: evo .github/run-all-benchmarks.lua
# GitHub adds a heading of their own, so remove the duplicate
- name: Generate CHANGELOG.MD
run: evo create-changelog.lua && tail -n +3 CHANGELOG.MD > CHANGELOG-GITHUB.MD && mv CHANGELOG-GITHUB.MD CHANGELOG.MD
- name: Publish new release
# Truly "continuous" releases may be overkill here, so better only release tagged versions
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: evo.exe
body_path: CHANGELOG.MD
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}