* build.sh: support building SDL3 with cmake * ci: install cmake * ci: make msvc use bash to build again * ci: use get-command to get link.exe * build.sh: revert back to CMAKE_INSTALL_PREFIX * ci: hardcode CMAKE_INSTALL_LIBDIR * ci: set cc_ld to not step on cmake * build.sh: less messing with cwd * build.sh: fix prefix once and for all * ci: skip installing cmake on macos to avoid warnings * build.sh: pass MACOSX_DEPLOYMENT_TARGET to cmake * build.sh: remove extra .. in configure command * build.sh: remove unused variable * build.sh: allow SIMD runtime detection * build.sh: propagate LTO to SDL3
301 lines
8.5 KiB
YAML
301 lines
8.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_linux:
|
|
name: Linux
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- { name: "GCC", cc: gcc, cxx: g++ }
|
|
# disable this until we have clang in the build box
|
|
# - { name: "clang", cc: clang, cxx: clang++ }
|
|
env:
|
|
CC: ${{ matrix.config.cc }}
|
|
CXX: ${{ matrix.config.cxx }}
|
|
|
|
steps:
|
|
- name: Set Environment Variables
|
|
if: ${{ matrix.config.cc == 'gcc' }}
|
|
run: |
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-linux-$(uname -m)-portable" >> "$GITHUB_ENV"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
# disabled because this will break our own Python install
|
|
- name: Python Setup
|
|
if: false
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
# disabled because the container has up-to-date packages
|
|
- name: Update Packages
|
|
if: false
|
|
run: sudo apt-get update
|
|
|
|
# disabled as the dependencies are already installed
|
|
- name: Install Dependencies
|
|
if: false
|
|
run: bash scripts/install-dependencies.sh --debug
|
|
|
|
- name: Build
|
|
uses: docker://ghcr.io/lite-xl/lite-xl-build-box-manylinux:v4
|
|
with:
|
|
entrypoint: /entrypoint.sh
|
|
args: |
|
|
bash --version
|
|
bash scripts/build.sh --debug --forcefallback --portable
|
|
|
|
- name: Package
|
|
if: ${{ matrix.config.cc == 'gcc' }}
|
|
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --binary
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
if: ${{ matrix.config.cc == 'gcc' }}
|
|
with:
|
|
name: Linux Artifacts
|
|
path: ${{ env.INSTALL_NAME }}.tar.gz
|
|
compression-level: 0
|
|
|
|
build_macos:
|
|
name: macOS
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- { arch: x86_64, runner: macos-13 } # macos-13 uses x86_64
|
|
- { arch: arm64, runner: macos-14 } # macos-14 / latest uses M1
|
|
|
|
runs-on: ${{ matrix.config.runner }}
|
|
env:
|
|
CC: clang
|
|
CXX: clang++
|
|
|
|
steps:
|
|
- name: System Information
|
|
run: |
|
|
system_profiler SPSoftwareDataType
|
|
bash --version
|
|
gcc -v
|
|
xcodebuild -version
|
|
|
|
- name: Set Environment Variables
|
|
run: |
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Python Setup
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
# installing md5sha1sum will eliminate a warning with arm64 and libusb
|
|
- name: Install Dependencies
|
|
run: |
|
|
brew install bash md5sha1sum
|
|
pip install meson ninja dmgbuild
|
|
|
|
- name: Build
|
|
run: |
|
|
bash --version
|
|
bash scripts/build.sh --bundle --debug --forcefallback
|
|
|
|
- name: Create DMG Image
|
|
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --dmg
|
|
|
|
- name: Upload DMG Image
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macOS DMG Images (${{ matrix.config.arch }})
|
|
path: ${{ env.INSTALL_NAME }}.dmg
|
|
compression-level: 0
|
|
|
|
build_macos_universal:
|
|
name: macOS (Universal)
|
|
runs-on: macos-14
|
|
needs: build_macos
|
|
|
|
steps:
|
|
- name: System Information
|
|
run: |
|
|
system_profiler SPSoftwareDataType
|
|
bash --version
|
|
gcc -v
|
|
xcodebuild -version
|
|
|
|
- name: Set Environment Variables
|
|
run: |
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-macos-universal" >> "$GITHUB_ENV"
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install dmgbuild
|
|
run: pip install dmgbuild
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
id: download
|
|
with:
|
|
pattern: macOS DMG Images *
|
|
merge-multiple: true
|
|
path: dmgs-original
|
|
|
|
- name: Make universal bundles
|
|
run: |
|
|
bash --version
|
|
bash scripts/make-universal-binaries.sh ${{ steps.download.outputs.download-path }} "${INSTALL_NAME}"
|
|
|
|
- name: Upload DMG Image
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macOS DMG Images (Universal)
|
|
path: ${{ env.INSTALL_NAME }}.dmg
|
|
compression-level: 0
|
|
|
|
build_windows_msys2:
|
|
name: Windows
|
|
runs-on: windows-2019
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- { msystem: MINGW32, arch: i686 }
|
|
- { msystem: MINGW64, arch: x86_64 }
|
|
defaults:
|
|
run:
|
|
shell: msys2 {0}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup MSYS2
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: ${{ matrix.config.msystem }}
|
|
install: >-
|
|
base-devel
|
|
git
|
|
zip
|
|
patch
|
|
pacboy: >-
|
|
gcc:p
|
|
meson:p
|
|
cmake:p
|
|
ninja:p
|
|
pkg-config:p
|
|
ca-certificates:p
|
|
|
|
- name: Set Environment Variables
|
|
run: |
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
if [[ "${MSYSTEM}" == "MINGW64" ]]; then
|
|
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-windows-x86_64" >> "$GITHUB_ENV"
|
|
else
|
|
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-windows-i686" >> "$GITHUB_ENV"
|
|
fi
|
|
|
|
- name: Install Dependencies
|
|
if: false
|
|
run: bash scripts/install-dependencies.sh --debug
|
|
|
|
- name: Build
|
|
run: |
|
|
bash --version
|
|
bash scripts/build.sh -U --debug --forcefallback
|
|
|
|
- name: Package
|
|
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --binary
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Windows Artifacts (${{ matrix.config.msystem }})
|
|
path: ${{ env.INSTALL_NAME }}.zip
|
|
compression-level: 0
|
|
|
|
build_windows_msvc:
|
|
name: Windows (MSVC)
|
|
runs-on: windows-2019
|
|
strategy:
|
|
matrix:
|
|
arch:
|
|
- { target: x86, name: i686 }
|
|
- { target: x64, name: x86_64 }
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup MSVC
|
|
id: msvc-dev-cmd
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: ${{ matrix.arch.target }}
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install meson and ninja
|
|
run: pip install --no-cache-dir meson ninja
|
|
|
|
- name: Export GitHub Actions cache environment variables
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
|
|
- name: Install pkgconf
|
|
env: { VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" }
|
|
run: vcpkg install pkgconf:x64-windows-release
|
|
|
|
# https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#name-conflicts-with-shell-bash
|
|
- name: Set environment variables
|
|
run: |
|
|
echo "PKG_CONFIG=C:\vcpkg\installed\x64-windows-release\tools\pkgconf\pkgconf.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
echo "CC_LD=$((Get-Command link.exe).Source)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
- name: Build
|
|
run: bash scripts/build.sh --addons --debug --forcefallback --lto --portable --mode ${{ needs.version.outputs.buildtype }} -b build
|
|
|
|
- name: Package
|
|
run: |
|
|
Remove-Item -Recurse -Force -Path "lite-xl/lib","lite-xl/include"
|
|
7z a -mx=9 "$env:INSTALL_NAME.zip" lite-xl
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Windows Artifacts (MSVC ${{ matrix.arch.target }})
|
|
path: ${{ env.INSTALL_NAME }}.zip
|
|
compression-level: 0
|