Update GitHub build workflow runners #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build, check and LDView | |
# Trevor SANDY <[email protected]> | |
# Last Update: September 09, 2024 | |
# Copyright (C) 2022 - 2024 by Trevor SANDY | |
# | |
name: Build LDView | |
on: | |
push: | |
branches: | |
- lpub3d-build | |
jobs: | |
build-linux: | |
# if: ${{ false }} # uncomment to disable | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Work Paths | |
run: | | |
echo "LDRAWDIR=${HOME}/ldraw" >> ${GITHUB_ENV} | |
echo "LDV_DIST_DIR=lpub3d_linux_3rdparty" >> ${GITHUB_ENV} | |
echo "LDV_DIST_DIR_CREATE=${HOME}/work/ldview/ldview/lpub3d_linux_3rdparty" >> ${GITHUB_ENV} | |
- name: Development Packages | |
run: | | |
echo "Install development packages..." | |
$(cd QT; sed -e '/libqt4-dev/d' -e '/qt6-base-dev/d' -e '/^#Qt/d' -e '/qtbase5/s/^#//' -i debian/control) | |
chmod a+x QT/docker/install-devel-packages.sh && sudo ./QT/docker/install-devel-packages.sh | |
- name: Cache LDraw | |
id: cache-ldraw | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.LDRAWDIR }} | |
key: ldraw-lib | |
- name: LDraw Library | |
run: | | |
if [ ! -d ${LDRAWDIR}/parts ]; then | |
echo "LDraw library not found at ${LDRAWDIR}. Downloading library..." | |
curl -s -O https://library.ldraw.org/library/updates/complete.zip | |
unzip -d ~/ -q complete.zip; rm complete.zip | |
if test -d ${LDRAWDIR}; then echo "LDraw library extracted, LDRAWDIR defined."; fi | |
else | |
echo "LDraw library defined at ${LDRAWDIR}." | |
fi | |
- name: Stdlib Patch | |
run: | | |
echo "Apply stdlib error patch to LDViewGlobal.pri..." | |
sed s/' # detect system libraries paths'/' # Suppress fatal error: stdlib.h: No such file or directory\n QMAKE_CFLAGS_ISYSTEM = -I\n\n # detect system libraries paths'/ -i LDViewGlobal.pri | |
- name: Build LDView | |
run: | | |
if [ ! -d "${LDV_DIST_DIR_CREATE}" ]; then mkdir -p "${LDV_DIST_DIR_CREATE}" && echo "${LDV_DIST_DIR_CREATE} created."; fi | |
qmake -v; $(cd QT ; sed -i 's/kdelibs5-dev, //g' debian/control) | |
qmake CONFIG+=3RD_PARTY_INSTALL=../${LDV_DIST_DIR} CONFIG+=release CONFIG+=BUILD_CUI_ONLY CONFIG+=USE_SYSTEM_LIBS CONFIG+=BUILD_CHECK | |
make && make install | |
build-windows: | |
# if: ${{ false }} # uncomment to disable | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Work Paths | |
run: | | |
Echo "LP3D_DIST_DIR_PATH=$(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
Echo "LP3D_LDRAW_DIR_PATH=$(Join-Path (resolve-path $Env:USERPROFILE\) 'ldraw')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
Echo "LP3D_3RD_PARTY_PATH=$(resolve-path ..\)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
If ( -Not (Test-Path -Path $(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty') ) ) { New-Item -ItemType directory -Path $(Join-Path (resolve-path ..\) 'lpub3d_windows_3rdparty') } | |
- name: Cache LDraw | |
id: cache-ldraw | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.LP3D_LDRAW_DIR_PATH }} | |
key: ldraw-lib | |
- name: Windows 8.1 SDK | |
run: | | |
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing | |
Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit" | |
shell: powershell | |
- name: Build LDView | |
shell: cmd | |
run: .\build.cmd -all -chk | |
build-macos: | |
# if: ${{ false }} # uncomment to disable | |
runs-on: macos-13 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Work Paths | |
run: | | |
echo "LDRAWDIR=${HOME}/Library/ldraw" >> ${GITHUB_ENV} | |
echo "LDV_DIST_DIR=lpub3d_macos_3rdparty" >> ${GITHUB_ENV} | |
echo "LDV_DIST_DIR_CREATE=${HOME}/work/ldview/ldview/lpub3d_macos_3rdparty" >> ${GITHUB_ENV} | |
- name: Development Packages | |
run: | | |
echo "/usr/local/opt/ccache/libexec" >> ${GITHUB_PATH} | |
echo "Install development packages..." | |
brew install grep ccache tinyxml gl2ps minizip qt5 | |
brew link --force qt5; | |
if [[ -d /usr/X11/lib && /usr/X11/include ]]; then echo "Good to go - X11 found."; else brew install --cask xquartz; fi | |
- name: Cache LDraw | |
id: cache-ldraw | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.LDRAWDIR }} | |
key: ldraw-lib | |
- name: LDraw Library | |
run: | | |
if [ ! -d ${LDRAWDIR}/parts ]; then | |
echo "LDraw library not found at ${LDRAWDIR}. Downloading library..." | |
curl -s -O https://library.ldraw.org/library/updates/complete.zip | |
unzip -d ~/Library -q complete.zip; rm complete.zip | |
if test -d ${LDRAWDIR}; then echo "LDraw library extracted, LDRAWDIR defined."; fi | |
fi | |
echo "set LDRAWDIR in environment.plist..." | |
chmod a+x QT/set-ldrawdir.command && sudo ./QT/set-ldrawdir.command | |
grep -A1 -e 'LDRAWDIR' ~/.MacOSX/environment.plist | |
echo "LDraw library defined at ${LDRAWDIR}." | |
- name: Build LDView | |
run: | | |
if [ ! -d "${LDV_DIST_DIR_CREATE}" ]; then mkdir -p "${LDV_DIST_DIR_CREATE}" && echo "${LDV_DIST_DIR_CREATE} created."; fi | |
qmake -v | |
qmake CONFIG+=3RD_PARTY_INSTALL=../${LDV_DIST_DIR} CONFIG+=release CONFIG+=BUILD_CUI_ONLY CONFIG+=USE_SYSTEM_LIBS CONFIG+=BUILD_CHECK | |
make && make install |