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
10 changes: 10 additions & 0 deletions .github/linters/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Configuration for actionlint as run by the Lint Code Base workflow.
#
# The actionlint bundled with the linter image predates these GitHub-hosted
# runner images and reports them as unknown labels. Listing them here only
# teaches it the names; every actionlint check stays enabled.
self-hosted-runner:
labels:
- macos-15
- macos-15-intel
304 changes: 94 additions & 210 deletions .github/workflows/aptitude-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,217 +8,101 @@ on:

jobs:
build-apt-package:
runs-on: ubuntu-latest
# One package per supported Ubuntu release, each built on that release so
# its dependencies match.
runs-on: ubuntu-${{ matrix.ubuntu_version }}
strategy:
fail-fast: false
matrix:
ubuntu_version: ['22.04', '24.04']

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
libssl-dev \
libcurl4-openssl-dev \
libglfw3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
zlib1g-dev \
libjsoncpp-dev \
git \
debhelper \
devscripts \
dh-make \
reprepro \
gnupg

- name: Build project
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON ..
make -j$(nproc)

- name: Create Debian package
run: |
VERSION=$(git describe --tags --always 2>/dev/null | sed 's/^v//' || echo "0.1.0")
PACKAGE_NAME="bolt-cppml"
ARCH="amd64"
UBUNTU_VERSION="${{ matrix.ubuntu_version }}"

mkdir -p debian-package/DEBIAN
mkdir -p debian-package/usr/bin
mkdir -p debian-package/usr/lib/bolt-cppml
mkdir -p debian-package/usr/share/applications
mkdir -p debian-package/usr/share/doc/${PACKAGE_NAME}
mkdir -p debian-package/usr/share/pixmaps

# Copy main binary
if [ -f build/bolt ]; then
cp build/bolt debian-package/usr/bin/
else
echo "Warning: bolt binary not found, creating placeholder"
echo '#!/bin/bash' > debian-package/usr/bin/bolt
echo 'echo "Bolt C++ IDE"' >> debian-package/usr/bin/bolt
fi

# Copy bolt library
if [ -f build/libbolt_lib.so ]; then
cp build/libbolt_lib.so* debian-package/usr/lib/bolt-cppml/
fi

# Copy GGML/llama libraries from bin directory
if [ -d build/bin ]; then
for lib in build/bin/*.so*; do
if [ -f "$lib" ]; then
cp "$lib" debian-package/usr/lib/bolt-cppml/ 2>/dev/null || true
fi
done
fi

# Create ldconfig file
mkdir -p debian-package/etc/ld.so.conf.d
echo "/usr/lib/bolt-cppml" > debian-package/etc/ld.so.conf.d/bolt-cppml.conf

# Create control file
cat > debian-package/DEBIAN/control << EOF
Package: ${PACKAGE_NAME}
Version: ${VERSION}
Section: devel
Priority: optional
Architecture: ${ARCH}
Depends: libssl3 | libssl1.1, libcurl4, libglfw3, libgl1, libglu1-mesa, zlib1g, libjsoncpp25 | libjsoncpp24
Maintainer: Bolt C++ Team <team@bolt-cppml.org>
Description: Modern C++ implementation of Bolt IDE with AI integration
Bolt C++ is a modern C++ implementation of the Bolt IDE core components
with AI integration and real-time collaborative features.
.
Features include:
- GGML integration for AI model inference
- RWKV implementation for RNN capabilities
- Multi-cursor support and syntax highlighting
- Integrated debugger with breakpoints
- WebSocket server for real-time collaboration
- Comprehensive ImGui dark-mode interface
Homepage: https://github.com/cogpy/bolt-cppml
EOF

# Create postinst script to run ldconfig
cat > debian-package/DEBIAN/postinst << 'EOF'
#!/bin/bash
ldconfig
EOF
chmod 755 debian-package/DEBIAN/postinst

# Create postrm script
cat > debian-package/DEBIAN/postrm << 'EOF'
#!/bin/bash
ldconfig
EOF
chmod 755 debian-package/DEBIAN/postrm

# Create desktop entry
cat > debian-package/usr/share/applications/bolt-cppml.desktop << EOF
[Desktop Entry]
Type=Application
Name=Bolt C++
Comment=Modern C++ IDE with AI integration
Exec=/usr/bin/bolt
Icon=bolt-cppml
Terminal=false
Categories=Development;IDE;
EOF

# Copy documentation
cp README.md debian-package/usr/share/doc/${PACKAGE_NAME}/
if [ -f LICENSE ]; then
cp LICENSE debian-package/usr/share/doc/${PACKAGE_NAME}/copyright
elif [ -f LICENSE.md ]; then
cp LICENSE.md debian-package/usr/share/doc/${PACKAGE_NAME}/copyright
else
echo "MIT License" > debian-package/usr/share/doc/${PACKAGE_NAME}/copyright
echo "Copyright (c) 2025 Bolt C++ Team" >> debian-package/usr/share/doc/${PACKAGE_NAME}/copyright
fi

# Copy icon if exists
if [ -f generated-icon.png ]; then
cp generated-icon.png debian-package/usr/share/pixmaps/bolt-cppml.png
fi

# Set permissions
chmod 755 debian-package/DEBIAN
chmod 755 debian-package/usr/bin/bolt
find debian-package/usr/lib -name "*.so*" -exec chmod 644 {} \; 2>/dev/null || true

# Build .deb package
dpkg-deb --build debian-package ${PACKAGE_NAME}_${VERSION}_${ARCH}_ubuntu${UBUNTU_VERSION}.deb

- name: Create APT repository structure
run: |
VERSION=$(git describe --tags --always 2>/dev/null | sed 's/^v//' || echo "0.1.0")
PACKAGE_NAME="bolt-cppml"
ARCH="amd64"
UBUNTU_VERSION="${{ matrix.ubuntu_version }}"

mkdir -p apt-repo/conf
mkdir -p apt-repo/dists/ubuntu-${UBUNTU_VERSION}/main/binary-amd64
mkdir -p apt-repo/pool/main

# Create repository configuration
cat > apt-repo/conf/distributions << EOF
Origin: Bolt C++
Label: Bolt C++ Repository
Codename: ubuntu-${UBUNTU_VERSION}
Architectures: amd64
Components: main
Description: Bolt C++ IDE packages for Ubuntu ${UBUNTU_VERSION}
EOF

# Copy .deb to pool
cp ${PACKAGE_NAME}_${VERSION}_${ARCH}_ubuntu${UBUNTU_VERSION}.deb apt-repo/pool/main/

# Create Packages file
cd apt-repo
dpkg-scanpackages pool/main /dev/null > dists/ubuntu-${UBUNTU_VERSION}/main/binary-amd64/Packages
gzip -9c dists/ubuntu-${UBUNTU_VERSION}/main/binary-amd64/Packages > dists/ubuntu-${UBUNTU_VERSION}/main/binary-amd64/Packages.gz

# Create Release file
cat > dists/ubuntu-${UBUNTU_VERSION}/Release << EOF
Origin: Bolt C++
Label: Bolt C++ Repository
Suite: ubuntu-${UBUNTU_VERSION}
Codename: ubuntu-${UBUNTU_VERSION}
Version: ${VERSION}
Architectures: amd64
Components: main
Description: Bolt C++ IDE packages for Ubuntu ${UBUNTU_VERSION}
Date: $(date -R)
EOF

- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: debian-package-ubuntu-${{ matrix.ubuntu_version }}
path: '*.deb'

- name: Upload APT repository
uses: actions/upload-artifact@v4
with:
name: apt-repo-ubuntu-${{ matrix.ubuntu_version }}
path: 'apt-repo/**'

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: '*.deb'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4

- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential cmake pkg-config git dpkg-dev \
libssl-dev libcurl4-openssl-dev libglfw3-dev \
libgl1-mesa-dev libglu1-mesa-dev zlib1g-dev libjsoncpp-dev

- name: Build project
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON
cmake --build build -j "$(nproc)"

- name: Determine version
id: version
# A tag v1.2.3 gives 1.2.3. Any other run gives the project version
# plus the commit, for example 1.2.3+git0a1b2c3.
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF_NAME#v}"
else
BASE="$(sed -n 's/^project(bolt VERSION \([0-9.]*\).*/\1/p' CMakeLists.txt)"
VERSION="${BASE}+git$(git rev-parse --short HEAD)"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "deb=bolt-cppml_${VERSION}_ubuntu${{ matrix.ubuntu_version }}_amd64.deb" >> "$GITHUB_OUTPUT"

- name: Build Debian package
run: scripts/build-deb.sh build "${{ steps.version.outputs.version }}" "${{ steps.version.outputs.deb }}"

- name: Install the package and run bolt from it
run: |
sudo apt-get install -y "./${{ steps.version.outputs.deb }}"
/usr/bin/bolt --version
printf 'hello\n/exit\n' | /usr/bin/bolt | grep -q 'Echo: hello'
sudo apt-get remove -y bolt-cppml

- name: Create APT repository
# A flat repository for this Ubuntu release. It is unsigned; sign it
# before publishing it anywhere apt will fetch it from.
run: |
VERSION="${{ steps.version.outputs.version }}"
DEB="${{ steps.version.outputs.deb }}"
SUITE="ubuntu-${{ matrix.ubuntu_version }}"

mkdir -p "apt-repo/dists/$SUITE/main/binary-amd64" apt-repo/pool/main
cp "$DEB" apt-repo/pool/main/

(
cd apt-repo
dpkg-scanpackages pool/main /dev/null > "dists/$SUITE/main/binary-amd64/Packages"
gzip -9c "dists/$SUITE/main/binary-amd64/Packages" > "dists/$SUITE/main/binary-amd64/Packages.gz"

{
echo "Origin: Bolt C++"
echo "Label: Bolt C++ Repository"
echo "Suite: $SUITE"
echo "Codename: $SUITE"
echo "Version: $VERSION"
echo "Architectures: amd64"
echo "Components: main"
echo "Description: Bolt C++ IDE packages for Ubuntu ${{ matrix.ubuntu_version }}"
echo "Date: $(date -R)"
} > "dists/$SUITE/Release"
)

grep -q '^Package: bolt-cppml$' "apt-repo/dists/$SUITE/main/binary-amd64/Packages"
tar -czf "bolt-cppml-apt-repo-${SUITE}.tar.gz" apt-repo

- name: Upload APT repository
uses: actions/upload-artifact@v4
with:
name: apt-repo-ubuntu-${{ matrix.ubuntu_version }}
path: 'apt-repo/**'

- name: Attach repository archive to the release
# The .deb itself is attached by the Debian Package Build workflow.
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: 'bolt-cppml-apt-repo-*.tar.gz'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:

- name: Upload packages to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
build/*.exe
Expand Down
Loading
Loading