Skip to content

fix: use csbuild/make.sh + MSYS2 for proper Windows support #4

fix: use csbuild/make.sh + MSYS2 for proper Windows support

fix: use csbuild/make.sh + MSYS2 for proper Windows support #4

Workflow file for this run

name: CI
on:
push:
branches: [master, main, improve/*]
pull_request:
branches: [master, main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2022]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set platform identifiers
id: platform
shell: bash
run: |
case "${{ runner.os }}" in
Linux) echo "os=ubuntu" >> "$GITHUB_OUTPUT"
echo "arch=x86_64" >> "$GITHUB_OUTPUT" ;;
macOS) echo "os=macos" >> "$GITHUB_OUTPUT"
echo "arch=arm64" >> "$GITHUB_OUTPUT" ;;
Windows) echo "os=windows" >> "$GITHUB_OUTPUT"
echo "arch=x86_64" >> "$GITHUB_OUTPUT" ;;
esac
- name: Download CovScript SDK
id: sdk
shell: bash
run: |
OS="${{ steps.platform.outputs.os }}"
ARCH="${{ steps.platform.outputs.arch }}"
URL="https://github.com/covscript/csbuild/releases/download/${OS}-schedule/covscript-${OS}-${ARCH}-nightly.7z"
curl -fsSL "$URL" -o sdk.7z
7z x sdk.7z -y
mv build covscript-home
CS_HOME="${{ github.workspace }}/covscript-home"
CS_HOME="${CS_HOME//\\//}"
echo "cs_home=${CS_HOME}" >> "$GITHUB_OUTPUT"
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows'
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-make
- name: Build (Linux / macOS)
if: runner.os != 'Windows'
shell: bash
env:
CS_DEV_PATH: ${{ steps.sdk.outputs.cs_home }}/
run: bash csbuild/make.sh
- name: Build (Windows)
if: runner.os == 'Windows'
shell: bash
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
run: |
export PATH="${{ steps.msys2.outputs.msys2-location }}/ucrt64/bin:${PATH}"
export CS_DEV_PATH="$(cygpath -u "${{ steps.sdk.outputs.cs_home }}")/"
bash csbuild/make.sh