Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
111 changes: 111 additions & 0 deletions .github/workflows/cpp_server_build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,64 @@ jobs:
path: build/lemonade-server_${{ env.LEMONADE_VERSION }}_amd64.deb
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmerFarukOruc please replace the existing Fedora instructions in the Install Options website with a link to the RPM in the release, and provide a screenshot of the rendered page.

Currently looks like this:
Image

Should look like this:

Image

If the plan is to use the AppImage as an optional frontend, please include this text too:

Image

retention-days: 7

build-lemonade-rpm:
name: Build Lemonade .rpm Package
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add a line here to add Fedora and the .rpm artifact to the tabe:

echo "| **Ubuntu** | [lemonade-server_${VERSION}_amd64.deb](https://github.com/$REPO/releases/download/$TAG_NAME/lemonade-server_${VERSION}_amd64.deb) (Server) · [Lemonade-${VERSION}-x86_64.AppImage](https://github.com/$REPO/releases/download/$TAG_NAME/Lemonade-${VERSION}-x86_64.AppImage) (Standalone App) |"

And remove the Fedora mention from the "Other platforms: ..." note.

Currently looks like this when rendered:

Image

runs-on: ubuntu-latest
container:
image: fedora:latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
clean: true
fetch-depth: 0

- name: Install RPM packaging tools
shell: bash
run: |
set -e
dnf install -y rpm-build

- name: Get version from CMakeLists.txt
id: get_version
uses: ./.github/actions/get-version

- name: Build Linux .rpm package
shell: bash
run: |
set -e

echo "Running setup.sh to configure build environment..."
bash setup.sh

echo "Building lemonade-router and lemonade-server for Fedora..."
cmake --build --preset default

RPM_FILE="lemonade-server-${LEMONADE_VERSION}.x86_64.rpm"

cd build

echo "Creating .rpm package with CPack..."
cpack -G RPM -V

if [ ! -f "$RPM_FILE" ]; then
echo "ERROR: .rpm package not created!"
echo "Contents of build directory:"
ls -lR .
exit 1
fi

echo "Package information:"
rpm -qip "$RPM_FILE"

- name: Upload .rpm package
uses: actions/upload-artifact@v4
with:
name: lemonade-rpm
path: build/lemonade-server-${{ env.LEMONADE_VERSION }}.x86_64.rpm
retention-days: 7

build-lemonade-macos-dmg:
name: Build Lemonade macOS .dmg (with Electron App)
runs-on: macos-latest
Expand Down Expand Up @@ -794,6 +852,49 @@ jobs:
if: always()
uses: ./.github/actions/cleanup-processes-linux

test-rpm-package:
name: Test .rpm - Fedora
runs-on: ubuntu-latest
needs: build-lemonade-rpm
container:
image: fedora:latest
env:
LEMONADE_VERSION: ${{ needs.build-lemonade-rpm.outputs.version }}
steps:
- name: Download Lemonade .rpm Package
uses: actions/download-artifact@v4
with:
name: lemonade-rpm
path: .

- name: Install and verify Lemonade (.rpm)
shell: bash
run: |
set -e

RPM_FILE="lemonade-server-${LEMONADE_VERSION}.x86_64.rpm"

if [ ! -f "$RPM_FILE" ]; then
echo "ERROR: .rpm file not found: $RPM_FILE"
ls -la *.rpm 2>/dev/null || echo "No .rpm files found in current directory"
exit 1
fi

dnf install -y shadow-utils "$RPM_FILE"

echo "Installed package information:"
rpm -qi lemonade-server

echo "Installed file list:"
rpm -ql lemonade-server | sort

test -f /etc/lemonade/lemonade.conf
test -f /opt/bin/lemonade-server
test -f /opt/bin/lemonade-router

lemonade-server --version
lemonade-router --version
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Call router with absolute install path in RPM test

This smoke test invokes lemonade-router --version, but the Linux packaging rules install the router under /opt/bin and do not create a /usr/bin/lemonade-router symlink, so the command is typically not on Fedora's default PATH. Since release now depends on test-rpm-package, this can fail tag releases even when the RPM built correctly; invoke /opt/bin/lemonade-router (or export PATH) here.

Useful? React with 👍 / 👎.


test-dmg-inference:
name: Test .dmg - llamacpp (metal)
runs-on: macos-latest
Expand Down Expand Up @@ -1040,9 +1141,11 @@ jobs:
needs:
- sign-msi-installers
- build-lemonade-deb
- build-lemonade-rpm
- build-lemonade-macos-dmg
- build-lemonade-appimage
- test-cli-endpoints
- test-rpm-package
if: startsWith(github.ref, 'refs/tags/v')
env:
LEMONADE_VERSION: ${{ needs.build-lemonade-deb.outputs.version }}
Expand All @@ -1064,6 +1167,12 @@ jobs:
name: lemonade-deb
path: .

- name: Download Lemonade .rpm Package
uses: actions/download-artifact@v4
with:
name: lemonade-rpm
path: .

- name: Download Lemonade macOS .pkg Package
uses: actions/download-artifact@v4
with:
Expand All @@ -1082,6 +1191,7 @@ jobs:
ls -lh lemonade-server-minimal.msi
ls -lh lemonade.msi
ls -lh lemonade-server_${LEMONADE_VERSION}_amd64.deb
ls -lh lemonade-server-${LEMONADE_VERSION}.x86_64.rpm
ls -lh *.pkg
ls -lh Lemonade-${LEMONADE_VERSION}-x86_64.AppImage

Expand All @@ -1102,6 +1212,7 @@ jobs:
lemonade-server-minimal.msi
lemonade.msi
lemonade-server_${{ env.LEMONADE_VERSION }}_amd64.deb
lemonade-server-${{ env.LEMONADE_VERSION }}.x86_64.rpm
*.pkg
Lemonade-${{ env.LEMONADE_VERSION }}-x86_64.AppImage
fail_on_unmatched_files: true
8 changes: 6 additions & 2 deletions src/cpp/CPackRPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ set(CPACK_RPM_PACKAGE_REQUIRES "libcurl, openssl, zlib")
# Architecture and file name
set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
set(CPACK_PACKAGE_FILE_NAME "lemonade-server-${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}")
set(CPACK_PACKAGE_RELOCATABLE OFF)
set(CPACK_RPM_PACKAGE_RELOCATABLE OFF)

# Provide script hooks (optional)
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
# Provide RPM-native script hooks
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/postinst-rpm")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/prerm-rpm")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/postrm-rpm")

# End of RPM config.
25 changes: 25 additions & 0 deletions src/cpp/postinst-rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

if ! getent group lemonade > /dev/null 2>&1; then
groupadd -r lemonade > /dev/null 2>&1 || true
fi

if ! getent passwd lemonade > /dev/null 2>&1; then
useradd -m -r -g lemonade -d /opt/var/lib/lemonade -s /usr/sbin/nologin lemonade > /dev/null 2>&1 || true
fi

mkdir -p /opt/var/lib/lemonade
chown lemonade:lemonade /opt/var/lib/lemonade > /dev/null 2>&1 || true

usermod -a -G render lemonade > /dev/null 2>&1 || true

if getent group systemd-journal > /dev/null 2>&1; then
usermod -a -G systemd-journal lemonade > /dev/null 2>&1 || true
fi

if command -v systemctl > /dev/null 2>&1 && [ -d /run/systemd/system ]; then
systemctl daemon-reload > /dev/null 2>&1 || true
fi

exit 0
8 changes: 8 additions & 0 deletions src/cpp/postrm-rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

if command -v systemctl > /dev/null 2>&1 && [ -d /run/systemd/system ]; then
systemctl daemon-reload > /dev/null 2>&1 || true
fi

exit 0
8 changes: 8 additions & 0 deletions src/cpp/prerm-rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

if command -v systemctl > /dev/null 2>&1 && [ -d /run/systemd/system ]; then
systemctl stop lemonade-server.service > /dev/null 2>&1 || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve service availability during RPM upgrades

The new %preun hook always executes systemctl stop lemonade-server.service, but %post only does daemon-reload, so upgrading from one RPM version to the next leaves the service stopped until an operator manually starts it. This creates avoidable downtime on systemd hosts; make the stop conditional to erase-only or add a restart/try-restart path in post-install for upgrades.

Useful? React with 👍 / 👎.

fi

exit 0