mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
194 lines
6.4 KiB
YAML
194 lines
6.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
windows:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt6
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: '6.8.1'
|
|
arch: 'win64_mingw'
|
|
cache: true
|
|
aqtversion: '==3.1.21'
|
|
|
|
- name: Configure
|
|
shell: bash
|
|
run: |
|
|
export PATH="/c/mingw64/bin:$PATH"
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_UI_TESTS=OFF \
|
|
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
|
|
|
- name: Build
|
|
shell: bash
|
|
run: |
|
|
export PATH="/c/mingw64/bin:$PATH"
|
|
cmake --build build
|
|
|
|
- name: Test
|
|
shell: bash
|
|
run: |
|
|
export PATH="/c/mingw64/bin:$PATH"
|
|
ctest --test-dir build --output-on-failure
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: Reclass-win64-qt6
|
|
path: |
|
|
build/Reclass.exe
|
|
build/ReclassMcpBridge.exe
|
|
build/Plugins/*.dll
|
|
build/*.dll
|
|
build/platforms/
|
|
build/styles/
|
|
build/imageformats/
|
|
build/iconengines/
|
|
build/themes/
|
|
build/examples/
|
|
build/screenshot.png
|
|
|
|
- name: Get date tag
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
id: date
|
|
shell: bash
|
|
run: echo "tag=$(date +'%d-%m-%Y')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Package release zip
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
shell: bash
|
|
run: |
|
|
mkdir -p release
|
|
cp build/Reclass.exe release/
|
|
cp build/ReclassMcpBridge.exe release/
|
|
cp build/*.dll release/ 2>/dev/null || true
|
|
cp -r build/platforms release/ 2>/dev/null || true
|
|
cp -r build/styles release/ 2>/dev/null || true
|
|
cp -r build/imageformats release/ 2>/dev/null || true
|
|
cp -r build/iconengines release/ 2>/dev/null || true
|
|
mkdir -p release/Plugins
|
|
cp build/Plugins/*.dll release/Plugins/ 2>/dev/null || true
|
|
cp -r build/themes release/ 2>/dev/null || true
|
|
cp -r build/examples release/ 2>/dev/null || true
|
|
cp build/screenshot.png release/ 2>/dev/null || true
|
|
cd release && 7z a ../Reclass-win64-qt6.zip *
|
|
|
|
- name: Upload release asset
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: snapshot-${{ steps.date.outputs.tag }}
|
|
name: Snapshot ${{ steps.date.outputs.tag }}
|
|
body: |
|
|
Automated snapshot from main branch.
|
|
Commit: ${{ github.sha }}
|
|
prerelease: false
|
|
files: Reclass-win64-qt6.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
linux:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt6
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: '6.8.1'
|
|
cache: true
|
|
aqtversion: '==3.1.21'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build libgl1-mesa-dev libfuse2 libxcb-cursor0
|
|
|
|
- name: Configure
|
|
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_UI_TESTS=OFF
|
|
|
|
- name: Build
|
|
run: cmake --build build
|
|
|
|
- name: Test
|
|
run: ctest --test-dir build --output-on-failure
|
|
|
|
- name: Create AppImage
|
|
run: |
|
|
# Download linuxdeploy and Qt plugin
|
|
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
|
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-qt-x86_64.AppImage
|
|
|
|
# Build AppDir structure
|
|
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/256x256/apps
|
|
cp build/Reclass AppDir/usr/bin/
|
|
cp build/ReclassMcpBridge AppDir/usr/bin/
|
|
cp -r build/themes AppDir/usr/bin/ 2>/dev/null || true
|
|
cp -r build/examples AppDir/usr/bin/ 2>/dev/null || true
|
|
mkdir -p AppDir/usr/bin/Plugins
|
|
cp build/Plugins/*.so AppDir/usr/bin/Plugins/ 2>/dev/null || true
|
|
cp src/icons/class.png AppDir/usr/share/icons/hicolor/256x256/apps/reclass.png
|
|
|
|
# Create AppImage with Qt libs bundled
|
|
# install-qt-action adds Qt bin to PATH; find qmake there
|
|
QMAKE_BIN=$(which qmake 2>/dev/null || which qmake6 2>/dev/null || find "$RUNNER_WORKSPACE" -name qmake -path "*/bin/*" | head -1)
|
|
echo "Found qmake at: $QMAKE_BIN"
|
|
export QMAKE="$QMAKE_BIN"
|
|
QT_ROOT=$(dirname "$(dirname "$QMAKE_BIN")")
|
|
export LD_LIBRARY_PATH="$QT_ROOT/lib:$LD_LIBRARY_PATH"
|
|
export EXTRA_QT_PLUGINS="svg;iconengines"
|
|
./linuxdeploy-x86_64.AppImage --appdir AppDir \
|
|
--desktop-file deploy/Reclass.desktop \
|
|
--icon-file AppDir/usr/share/icons/hicolor/256x256/apps/reclass.png \
|
|
--plugin qt \
|
|
--output appimage
|
|
# Rename to final name
|
|
ls Reclass-*.AppImage
|
|
mv Reclass-*.AppImage Reclass-linux64-qt6.AppImage
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: Reclass-linux64-qt6
|
|
path: Reclass-linux64-qt6.AppImage
|
|
|
|
- name: Get date tag
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
id: date
|
|
shell: bash
|
|
run: echo "tag=$(date +'%d-%m-%Y')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Upload release asset
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: snapshot-${{ steps.date.outputs.tag }}
|
|
name: Snapshot ${{ steps.date.outputs.tag }}
|
|
body: |
|
|
Automated snapshot from main branch.
|
|
Commit: ${{ github.sha }}
|
|
prerelease: false
|
|
files: Reclass-linux64-qt6.AppImage
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|