Skip to content

Commit 627bfdc

Browse files
committed
experimental github workflow
1 parent 4519471 commit 627bfdc

File tree

20 files changed

+408
-19
lines changed

20 files changed

+408
-19
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: PPUC-Serum-Colorizer
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.platform }}-${{ matrix.arch }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: ubuntu-latest
20+
platform: linux
21+
arch: x64
22+
- os: macos-14
23+
platform: macos
24+
arch: arm64
25+
- os: macos-13
26+
platform: macos
27+
arch: x64
28+
- os: windows-2025
29+
platform: win
30+
arch: x64
31+
- os: windows-2025
32+
platform: win
33+
arch: x86
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Fetch libserum
37+
run: |
38+
rm -rf libserum
39+
git clone https://github.com/PPUC/libserum.git libserum
40+
(cd libserum && git checkout c8f94a5df229888428a4421e42c1d1b640ec98b7)
41+
42+
- if: matrix.platform == 'linux'
43+
name: Install dependencies (linux)
44+
run: |
45+
sudo apt-get update -y
46+
sudo apt-get install -y cmake ninja-build pkg-config qt6-base-dev qt6-base-dev-tools libqt6opengl6-dev libopencv-dev
47+
48+
- if: matrix.platform == 'macos'
49+
name: Install dependencies (macOS)
50+
run: |
51+
brew install qt opencv
52+
echo "CMAKE_PREFIX_PATH=$(brew --prefix qt)" >> "$GITHUB_ENV"
53+
echo "OpenCV_DIR=$(brew --prefix opencv)/lib/cmake/opencv4" >> "$GITHUB_ENV"
54+
55+
- if: matrix.platform == 'win'
56+
name: Setup vcpkg (Windows)
57+
shell: pwsh
58+
run: |
59+
$root = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
60+
git clone https://github.com/microsoft/vcpkg.git $root
61+
& "$root/bootstrap-vcpkg.bat"
62+
$triplet = if ("${{ matrix.arch }}" -eq "x86") { "x86-windows" } else { "x64-windows" }
63+
& "$root/vcpkg.exe" install opencv qtbase --triplet $triplet
64+
"VCPKG_ROOT=$root" | Out-File -FilePath $env:GITHUB_ENV -Append
65+
"VCPKG_DEFAULT_TRIPLET=$triplet" | Out-File -FilePath $env:GITHUB_ENV -Append
66+
67+
- if: matrix.platform == 'win'
68+
name: Add msbuild (Windows)
69+
uses: microsoft/setup-msbuild@v2
70+
71+
- name: Build
72+
env:
73+
BUILD_TYPE: Release
74+
run: |
75+
chmod +x platforms/**/build.sh platforms/**/external.sh
76+
./platforms/${{ matrix.platform }}/${{ matrix.arch }}/build.sh
77+
78+
- name: Upload artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: PPUC-Serum-Colorizer-${{ matrix.platform }}-${{ matrix.arch }}
82+
path: artifacts/${{ matrix.platform }}-${{ matrix.arch }}

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Codex Notes: ColorizingDMD Editor + libserum
1+
# Codex Notes: PPUC-Serum-Colorizer Editor + libserum
22

33
## Scope
44
- This file documents development context and non-obvious legacy-format behavior.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.20)
22

3-
project(ColorizingDMD LANGUAGES CXX)
3+
project(PPUC-Serum-Colorizer VERSION 0.1.0 LANGUAGES CXX)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)

app/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
add_executable(ColorizingDMD)
1+
set(APP_NAME "PPUC-Serum-Colorizer")
2+
add_executable(${APP_NAME})
23

3-
target_sources(ColorizingDMD PRIVATE
4+
target_sources(${APP_NAME} PRIVATE
45
main.cpp
56
MainWindow.cpp
67
MainWindow.h
@@ -25,7 +26,7 @@ target_sources(ColorizingDMD PRIVATE
2526
option(COLORIZINGDMD_BUILD_WIN32_APP "Build the legacy Win32 UI sources" OFF)
2627

2728
if (WIN32 AND COLORIZINGDMD_BUILD_WIN32_APP)
28-
target_sources(ColorizingDMD PRIVATE
29+
target_sources(${APP_NAME} PRIVATE
2930
../ColorizingDMD.cpp
3031
../OGL_Immediate_2D.cpp
3132
../dmddevice.cpp
@@ -38,15 +39,15 @@ if (WIN32 AND COLORIZINGDMD_BUILD_WIN32_APP)
3839
)
3940
endif ()
4041

41-
target_link_libraries(ColorizingDMD PRIVATE
42+
target_link_libraries(${APP_NAME} PRIVATE
4243
colorizing_core
4344
Qt6::Widgets
4445
Qt6::Gui
4546
Qt6::OpenGL
4647
Qt6::OpenGLWidgets
4748
)
4849

49-
target_include_directories(ColorizingDMD PRIVATE
50+
target_include_directories(${APP_NAME} PRIVATE
5051
${CMAKE_SOURCE_DIR}
5152
${CMAKE_SOURCE_DIR}/libserum/src
5253
)

app/MainWindow.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,11 @@ MainWindow::MainWindow(QWidget* parent)
661661
, m_spriteStore(new IndexedImageStore())
662662
, m_backgroundStore(new IndexedImageStore())
663663
{
664-
setWindowTitle("ColorizingDMD");
664+
const QString appName = QCoreApplication::applicationName().isEmpty()
665+
? QString("PPUC-Serum-Colorizer")
666+
: QCoreApplication::applicationName();
667+
const QString appVersion = QCoreApplication::applicationVersion();
668+
setWindowTitle(appVersion.isEmpty() ? appName : QString("%1 v%2").arg(appName, appVersion));
665669
setWindowIcon(QIcon(":/app/app.ico"));
666670
setMinimumSize(1200, 800);
667671

@@ -1972,7 +1976,15 @@ MainWindow::MainWindow(QWidget* parent)
19721976
auto* aboutAction = new QAction("&About", this);
19731977
helpMenu->addAction(aboutAction);
19741978
connect(aboutAction, &QAction::triggered, this, [this]() {
1975-
QMessageBox::information(this, "About ColorizingDMD", "ColorizingDMD Qt port (UI scaffolding).");
1979+
const QString appName = QCoreApplication::applicationName().isEmpty()
1980+
? QString("PPUC-Serum-Colorizer")
1981+
: QCoreApplication::applicationName();
1982+
const QString appVersion = QCoreApplication::applicationVersion().isEmpty()
1983+
? QString("0.1.0")
1984+
: QCoreApplication::applicationVersion();
1985+
QMessageBox::information(this,
1986+
QString("About %1").arg(appName),
1987+
QString("%1 v%2 (Qt port).").arg(appName, appVersion));
19761988
});
19771989

19781990
connect(m_state, &ProjectState::projectPathChanged, this, [this](const QString& path) {
@@ -3446,7 +3458,7 @@ MainWindow::MainWindow(QWidget* parent)
34463458
refreshFrameSpriteLists();
34473459
updateUndoActions();
34483460

3449-
QSettings settings("PPUC", "ColorizingDMD");
3461+
QSettings settings("PPUC", "PPUC-Serum-Colorizer");
34503462
const QStringList recent = settings.value("recentFiles").toStringList();
34513463
if (!recent.isEmpty()) {
34523464
m_state->setRecentFiles(recent);
@@ -3458,16 +3470,20 @@ MainWindow::MainWindow(QWidget* parent)
34583470

34593471
void MainWindow::updateWindowTitle()
34603472
{
3473+
const QString appName = QCoreApplication::applicationName().isEmpty()
3474+
? QString("PPUC-Serum-Colorizer")
3475+
: QCoreApplication::applicationName();
3476+
const QString appVersion = QCoreApplication::applicationVersion();
34613477
if (m_state->projectPath().isEmpty()) {
3462-
setWindowTitle("ColorizingDMD");
3478+
setWindowTitle(appVersion.isEmpty() ? appName : QString("%1 v%2").arg(appName, appVersion));
34633479
return;
34643480
}
3465-
setWindowTitle(QString("ColorizingDMD - %1").arg(m_state->projectPath()));
3481+
setWindowTitle(QString("%1 - %2").arg(appName, m_state->projectPath()));
34663482
}
34673483

34683484
void MainWindow::persistRecentFiles()
34693485
{
3470-
QSettings settings("PPUC", "ColorizingDMD");
3486+
QSettings settings("PPUC", "PPUC-Serum-Colorizer");
34713487
settings.setValue("recentFiles", m_state->recentFiles());
34723488
settings.sync();
34733489
}
@@ -7767,7 +7783,7 @@ void MainWindow::showSettingsDialog()
77677783
trimHistory(m_backgroundHistory);
77687784
updateNavigationButtons();
77697785
trimUndoStacks();
7770-
QSettings settings("PPUC", "ColorizingDMD");
7786+
QSettings settings("PPUC", "PPUC-Serum-Colorizer");
77717787
settings.setValue("maxHistoryDepth", m_maxHistoryDepth);
77727788
settings.setValue("maxUndoDepth", m_maxUndoDepth);
77737789
settings.sync();

app/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#include <QApplication>
22
#include <QGuiApplication>
33
#include <QIcon>
4+
#include <QCoreApplication>
45

56
#include "MainWindow.h"
67

78
int main(int argc, char *argv[])
89
{
910
QGuiApplication::setAttribute(Qt::AA_DontShowIconsInMenus, false);
1011
QApplication app(argc, argv);
12+
QCoreApplication::setOrganizationName("PPUC");
13+
QCoreApplication::setApplicationName("PPUC-Serum-Colorizer");
14+
QCoreApplication::setApplicationVersion("0.1.0");
1115

1216
MainWindow window;
1317
window.setWindowIcon(QIcon(":/app/app.ico"));

platforms/config.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6+
7+
if [ -z "${BUILD_TYPE}" ]; then
8+
BUILD_TYPE="Release"
9+
fi
10+
11+
LIBSERUM_SHA=c8f94a5df229888428a4421e42c1d1b640ec98b7
12+
13+
if [ -z "${PLATFORM}" ]; then
14+
PLATFORM="unknown"
15+
fi
16+
17+
if [ -z "${ARCH}" ]; then
18+
ARCH="unknown"
19+
fi
20+
21+
if [ -z "${BUILD_DIR}" ]; then
22+
BUILD_DIR="${ROOT_DIR}/build/${PLATFORM}-${ARCH}"
23+
fi
24+
25+
if [ -z "${ARTIFACT_DIR}" ]; then
26+
ARTIFACT_DIR="${ROOT_DIR}/artifacts/${PLATFORM}-${ARCH}"
27+
fi
28+
29+
echo "Build type: ${BUILD_TYPE}"
30+
echo "Build dir: ${BUILD_DIR}"
31+
echo "Artifacts: ${ARTIFACT_DIR}"
32+
echo ""

platforms/linux/aarch64/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
PLATFORM="linux"
6+
ARCH="aarch64"
7+
8+
source ./platforms/config.sh
9+
10+
BUILD_TYPE=${BUILD_TYPE:-Release}
11+
12+
BUILD_TYPE=${BUILD_TYPE} ./platforms/linux/aarch64/external.sh
13+
14+
CMAKE_ARGS=()
15+
if [ -n "${VCPKG_ROOT}" ]; then
16+
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
17+
fi
18+
19+
cmake -S "${ROOT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${CMAKE_ARGS[@]}"
20+
cmake --build "${BUILD_DIR}" --config "${BUILD_TYPE}"
21+
22+
mkdir -p "${ARTIFACT_DIR}"
23+
if [ -f "${BUILD_DIR}/app/PPUC-Serum-Colorizer" ]; then
24+
cp "${BUILD_DIR}/app/PPUC-Serum-Colorizer" "${ARTIFACT_DIR}/"
25+
fi
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
source ./platforms/config.sh
6+
7+
if [ ! -d "${ROOT_DIR}/libserum/.git" ]; then
8+
echo "Fetching libserum (${LIBSERUM_SHA})..."
9+
rm -rf "${ROOT_DIR}/libserum"
10+
git clone https://github.com/PPUC/libserum.git "${ROOT_DIR}/libserum"
11+
(cd "${ROOT_DIR}/libserum" && git checkout "${LIBSERUM_SHA}")
12+
fi
13+
14+
echo "External dependencies are provided by the CI runner."

platforms/linux/x64/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
PLATFORM="linux"
6+
ARCH="x64"
7+
8+
source ./platforms/config.sh
9+
10+
BUILD_TYPE=${BUILD_TYPE:-Release}
11+
12+
BUILD_TYPE=${BUILD_TYPE} ./platforms/linux/x64/external.sh
13+
14+
CMAKE_ARGS=()
15+
if [ -n "${VCPKG_ROOT}" ]; then
16+
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
17+
fi
18+
19+
cmake -S "${ROOT_DIR}" -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${CMAKE_ARGS[@]}"
20+
cmake --build "${BUILD_DIR}" --config "${BUILD_TYPE}"
21+
22+
mkdir -p "${ARTIFACT_DIR}"
23+
if [ -f "${BUILD_DIR}/app/PPUC-Serum-Colorizer" ]; then
24+
cp "${BUILD_DIR}/app/PPUC-Serum-Colorizer" "${ARTIFACT_DIR}/"
25+
fi

0 commit comments

Comments
 (0)