feat(packaging): add .deb and .dmg build scripts and integrate into CI/CD

This commit is contained in:
thePR0M3TH3AN committed 2026-03-14 16:42:09 -04:00
1 parent 6efd049851
commit 3165effa8a
5 files changed
+137 -6

No files matched your search

+27 -1
View File
@@ -51,8 +51,34 @@ jobs:
--name "${{ matrix.artifact_name }}" \
voxvera/cli.py
- name: Build .deb (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
chmod +x packaging/build_deb.sh
./packaging/build_deb.sh dist/${{ matrix.artifact_name }}
- name: Build .dmg (macOS)
if: matrix.os == 'macos-latest'
run: |
chmod +x packaging/build_dmg.sh
./packaging/build_dmg.sh dist/${{ matrix.artifact_name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.artifact_name }}
path: |
dist/${{ matrix.artifact_name }}
voxvera/resources/bin/*.deb
voxvera/resources/bin/*.dmg
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/${{ matrix.artifact_name }}
voxvera/resources/bin/*.deb
voxvera/resources/bin/*.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+19 -5
View File
@@ -60,6 +60,18 @@ Generates a standalone `.flatpak` bundle. Requires `flatpak-builder`.
./packaging/build_flatpak.sh
```
### Debian Package (Linux)
Generates a `.deb` package for Debian/Ubuntu systems.
```bash
./packaging/build_deb.sh
```
### DMG (macOS)
Generates a `.dmg` installer for macOS (must be run on macOS).
```bash
./packaging/build_dmg.sh
```
## 4. Release Execution
1. **Version Bump:** Update `__version__` in `voxvera/__init__.py` and `version` in `pyproject.toml`.
@@ -70,8 +82,10 @@ Generates a standalone `.flatpak` bundle. Requires `flatpak-builder`.
git tag -a vX.Y.Z -m "VoxVera vX.Y.Z"
git push origin main --tags
```
3. **GitHub Release:**
Create a release and upload the assets from `voxvera/resources/bin/` and `site/download/`.
```bash
gh release create vX.Y.Z voxvera/resources/bin/* site/download/*.zip --title "VoxVera vX.Y.Z" --notes "Release notes here..."
```
## 5. Automated Releases (GitHub Actions)
The repository is configured with a **Build Standalone Binaries** workflow that automatically runs when a new tag (`v*`) is pushed. This workflow:
- Builds native executables for **Linux**, **Windows (.exe)**, and **macOS**.
- Automatically attaches these binaries to the corresponding GitHub Release.
This ensures that Windows users receive a professional `voxvera-windows.exe` rather than having to rely on `.bat` or `.sh` scripts.
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e
# Ensure we are in project root
cd "$(dirname "$0")/.."
ARCH=$(uname -m)
# Debian uses amd64 instead of x86_64
if [ "$ARCH" == "x86_64" ]; then
DEB_ARCH="amd64"
elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "arm64" ]; then
DEB_ARCH="arm64"
else
DEB_ARCH="$ARCH"
fi
BINARY=${1:-"voxvera/resources/bin/voxvera-linux-$ARCH"}
if [ ! -f "$BINARY" ]; then
echo "Binary not found: $BINARY." >&2
exit 1
fi
VERSION=$(grep "__version__" voxvera/__init__.py | cut -d '"' -f 2)
PKG_DIR="build/voxvera_${VERSION}_${DEB_ARCH}"
echo "Building .deb package for version $VERSION ($DEB_ARCH)..."
rm -rf "$PKG_DIR"
mkdir -p "$PKG_DIR/usr/bin"
mkdir -p "$PKG_DIR/DEBIAN"
cp "$BINARY" "$PKG_DIR/usr/bin/voxvera"
chmod +x "$PKG_DIR/usr/bin/voxvera"
# Copy control file and update version/arch
cp packaging/deb/DEBIAN/control "$PKG_DIR/DEBIAN/control"
sed -i "s/^Version: .*/Version: $VERSION/" "$PKG_DIR/DEBIAN/control"
sed -i "s/^Architecture: .*/Architecture: $DEB_ARCH/" "$PKG_DIR/DEBIAN/control"
# Build the package
dpkg-deb --build "$PKG_DIR" "voxvera/resources/bin/voxvera_${VERSION}_${DEB_ARCH}.deb"
echo "Debian package created at voxvera/resources/bin/voxvera_${VERSION}_${DEB_ARCH}.deb"
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
# Ensure we are in project root
cd "$(dirname "$0")/.."
# This script is intended to be run on macOS
if [ "$(uname)" != "Darwin" ]; then
echo "Error: .dmg creation requires macOS." >&2
exit 1
fi
ARCH=$(uname -m)
BINARY=${1:-"voxvera/resources/bin/voxvera-macos-$ARCH"}
if [ ! -f "$BINARY" ]; then
echo "Binary not found: $BINARY." >&2
exit 1
fi
VERSION=$(grep "__version__" voxvera/__init__.py | cut -d '"' -f 2)
DMG_NAME="VoxVera_${VERSION}_${ARCH}.dmg"
STAGING_DIR="build/dmg_staging"
echo "Building .dmg package for version $VERSION ($ARCH)..."
rm -rf "$STAGING_DIR"
mkdir -p "$STAGING_DIR"
# For a CLI tool, we just put the binary in the DMG.
# In the future, we could create an .app bundle if there's a GUI.
cp "$BINARY" "$STAGING_DIR/voxvera"
chmod +x "$STAGING_DIR/voxvera"
# Create the DMG
hdiutil create -volname "VoxVera $VERSION" -srcfolder "$STAGING_DIR" -ov -format UDZO "voxvera/resources/bin/$DMG_NAME"
echo "DMG created at voxvera/resources/bin/$DMG_NAME"
+9
View File
@@ -0,0 +1,9 @@
Package: voxvera
Version: 0.1.4
Section: utils
Priority: optional
Architecture: amd64
Maintainer: VoxVera <[email protected]>
Description: VoxVera CLI utilities
Anonymous message-spreading and flyer-generation tool.
Depends: libc6