Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 69 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,146 +1,137 @@
name: CI

on:
push:
pull_request:
on: [push, pull_request]

# build setting(s)
env:
CONFIGURATION: Release

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows32
- os: windows-latest
name: Windows64
- os: ubuntu-22.04
name: Linux
- os: macos-26-intel
name: macOS-intel
build-windows32:
runs-on: windows-latest
name: Windows32

steps:
- name: Checkout repository recursively
uses: actions/checkout@v4
with:
submodules: recursive

# ======================================
# Windows32
# ======================================

- name: 'Windows32: Install Qt 5.15.2'
if: runner.os == 'Windows'
- name: 'Install Qt 5.15.2'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
arch: 'win32_msvc2019'

- name: 'Windows32: Build'
if: matrix.name == 'Windows32'
- name: 'Build'
run: |
mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A Win32
cmake -S .. -B . -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A Win32
cmake --build . --config $env:CONFIGURATION
cd $env:CONFIGURATION
mkdir deploy
move qt-editor.exe ./deploy
windeployqt ./deploy/qt-editor.exe --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw --no-svg --dir ./deploy --plugindir ./deploy/plugins

# ======================================
# Windows64
# ======================================
- name: 'Upload Artifact'
uses: actions/upload-artifact@v7
with:
name: Windows32-${{ env.CONFIGURATION }}-qt-editor
path: build\${{ env.CONFIGURATION }}\deploy

build-windows64:
runs-on: windows-latest
name: Windows64

steps:
- name: Checkout repository recursively
uses: actions/checkout@v4
with:
submodules: recursive

- name: 'Windows64: Install Qt 5.15.2'
if: runner.os == 'Windows'
- name: 'Install Qt 5.15.2'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
arch: 'win64_msvc2019_64'

- name: 'Windows64: Build'
if: matrix.name == 'Windows64'
- name: 'Build'
run: |
mkdir build
cd build
cmake .. -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A x64
cmake -S .. -B . -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" -A x64
cmake --build . --config $env:CONFIGURATION
cd $env:CONFIGURATION
mkdir deploy
move qt-editor.exe ./deploy
windeployqt ./deploy/qt-editor.exe --no-translations --no-system-d3d-compiler --no-angle --no-opengl-sw --no-svg --dir ./deploy --plugindir ./deploy/plugins

# ======================================
# Linux
# ======================================

- name: 'Linux: Install Qt 5.15.2'
if: matrix.name == 'Linux'
- name: 'Upload Artifact'
uses: actions/upload-artifact@v7
with:
name: Windows64-${{ env.CONFIGURATION }}-qt-editor
path: build\${{ env.CONFIGURATION }}\deploy

build-linux:
runs-on: ubuntu-22.04
name: Linux

steps:
- name: Checkout repository recursively
uses: actions/checkout@v4
with:
submodules: recursive

- name: 'Install Qt 5.15.2'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
arch: 'gcc_64'

- name: 'Linux: Build'
if: matrix.name == 'Linux'
- name: 'Build'
run: |
mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION
cmake -S .. -B . -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION
make -j$(nproc)
cpack -G DEB

# ======================================
# macOS-intel
# ======================================
- name: 'Upload Artifact'
uses: actions/upload-artifact@v7
with:
name: Linux-${{ env.CONFIGURATION }}-qt-editor.deb
path: build/relive-qt-editor-0.1.1-Linux.deb
archive: false

build-macos-intel:
runs-on: macos-26-intel
name: macOS Intel

steps:
- name: Checkout repository recursively
uses: actions/checkout@v4
with:
submodules: recursive

- name: 'macOS-intel: Install Qt 5.15.2'
if: matrix.name == 'macOS-intel'
- name: 'Install Qt 5.15.2'
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
arch: 'clang_64'

# TODO: mac artifacts
# cpack -G DragNDrop

- name: 'macOS-intel: Build'
if: matrix.name == 'macOS-intel'
- name: 'Build'
run: |
mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake -S .. -B . -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DCMAKE_POLICY_VERSION_MINIMUM=3.5
make -j4

# ======================================
# Artifacts
# ======================================

- name: 'Windows: Upload qt-editor binaries'
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-qt-editor
path: build\${{ env.CONFIGURATION }}\deploy

- name: 'Linux: Upload qt-editor deb'
if: matrix.name == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-qt-editor.deb
path: build/qt-editor-0.1.1-Linux.deb

# TODO
# TODO: mac artifacts
# cpack -G DragNDrop

# - name: 'macOS-intel: Upload relive dmg'
# if: matrix.name == 'macOS-intel'
# uses: actions/upload-artifact@v4
# - name: 'Upload Artifact'
# uses: actions/upload-artifact@v7
# with:
# name: ${{ matrix.name }}-${{ env.CONFIGURATION }}-relive.dmg
# path: build/relive-0.1-Darwin.dmg
# name: Intel-${{ env.CONFIGURATION }}-relive.dmg
# path: build/relive-0.1-Darwin.dmg
20 changes: 18 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# without this the editor will crash on startup:
# qt-editor: symbol lookup error: qt-editor: undefined symbol: _ZdlPvm, version Qt_5
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sized-deallocation")
endif()

# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check https://doc.qt.io/qt/deployment-android.html for more information.
# They need to be set before the find_package( ...) calls below.
Expand All @@ -31,6 +37,7 @@ set(TS_FILES qt-editor_en_GB.ts qt-editor_German.ts)

add_subdirectory(3rdParty/libmodplug)
add_subdirectory(3rdParty/alive_reversing/Source/Tools/relive_api)
add_subdirectory(assets)

include_directories(3rdParty/libmodplug/src)
include_directories(3rdParty/jsonxx)
Expand Down Expand Up @@ -145,9 +152,18 @@ endif()

target_link_libraries(qt-editor PUBLIC relive_api Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Multimedia modplug jsonxx)

set(CPACK_PACKAGE_NAME "qt-editor")
set(CPACK_PACKAGE_NAME "relive-qt-editor")
set(CPACK_PACKAGE_CONTACT "nemin@oddwords.hu")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://aliveteam.github.io/")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "qtdeclarative5-dev, qtmultimedia5-dev, qttools5-dev")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5core5a, libqt5gui5, libqt5widgets5, libqt5network5, libqt5multimedia5")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "An Open-Source Level Editor for Abe's Oddysee and Abe's Exoddus.
Team R.E.L.I.V.E. proudly presents the replacement for the legacy Paul's Level Editor.
.
Compared to the old editor it allows for editing far more kinds of objects, removes the arbitrary limitations the original engine imposed, and features a vastly improved user interface.")

if(UNIX)
set_target_properties(qt-editor PROPERTIES OUTPUT_NAME relive-qt-editor)
install(TARGETS qt-editor DESTINATION bin)
endif()

INCLUDE(CPack)
4 changes: 4 additions & 0 deletions assets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(UNIX)
install(FILES "${CMAKE_SOURCE_DIR}/Source/rsc/icons/icon.png" DESTINATION share/pixmaps/ RENAME relive-qt-editor.png)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/relive-qt-editor.desktop" DESTINATION share/applications/)
endif()
28 changes: 28 additions & 0 deletions assets/relive-qt-editor.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Desktop Entry]

# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=relive-qt-editor

# A comment which can/will be used as a tooltip
Comment=An Open-Source Level Editor for Abe's Oddysee and Abe's Exoddus

# The path to the folder in which the executable is run
Path=/usr/bin/

# The executable of the application, possibly with arguments.
Exec=relive-qt-editor

# The name of the icon that will be used to display this entry
Icon=relive-qt-editor.png

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Utility