diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 409c480e..e1aa1cc5 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -1,10 +1,11 @@ +--- name: Comprehensive CI/CD Pipeline on: push: - branches: [ main, develop ] + branches: [main, develop] pull_request: - branches: [ main ] + branches: [main] workflow_dispatch: env: @@ -27,7 +28,7 @@ jobs: echo 'Acquire::GzipIndexes "true";' >> /etc/apt/apt.conf.d/99translations echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf.d/99translations echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99translations - + # Update package lists apt update -y @@ -39,7 +40,7 @@ jobs: echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list apt update -y else - echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." + echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." echo "deb http://deb.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list.d/standard.list echo "deb-src http://deb.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/standard.list apt update -y @@ -85,11 +86,11 @@ jobs: - name: Build Debian package run: | echo "Building Debian package..." - + # Check if we have the necessary files if [ -f "Cargo.toml" ] && [ -d "debian" ]; then echo "✅ Found Cargo.toml and debian directory" - + # Build Debian package if [ -f "debian/rules" ]; then # Use debian/rules if it exists @@ -100,23 +101,21 @@ jobs: mkdir -p debian/apt-ostree/usr/bin cp target/release/apt-ostree debian/apt-ostree/usr/bin/ chmod +x debian/apt-ostree/usr/bin/apt-ostree - + # Create control file mkdir -p debian/apt-ostree/DEBIAN - cat > debian/apt-ostree/DEBIAN/control << 'EOF' -Package: apt-ostree -Version: 0.1.0 -Architecture: amd64 -Maintainer: Robojerk -Description: APT-OSTree package for Debian-based OSTree systems - A tool for managing OSTree deployments with APT package management. - Provides atomic updates and rollback capabilities for Debian systems. -EOF - + echo "Package: apt-ostree" > debian/apt-ostree/DEBIAN/control + echo "Version: 0.1.0" >> debian/apt-ostree/DEBIAN/control + echo "Architecture: amd64" >> debian/apt-ostree/DEBIAN/control + echo "Maintainer: Robojerk " >> debian/apt-ostree/DEBIAN/control + echo "Description: APT-OSTree package for Debian-based OSTree systems" >> debian/apt-ostree/DEBIAN/control + echo " A tool for managing OSTree deployments with APT package management." >> debian/apt-ostree/DEBIAN/control + echo " Provides atomic updates and rollback capabilities for Debian systems." >> debian/apt-ostree/DEBIAN/control + # Build package dpkg-deb --build debian/apt-ostree apt-ostree_0.1.0_amd64.deb fi - + # Check if package was created if ls *.deb >/dev/null 2>&1; then echo "✅ Debian package created successfully" @@ -135,17 +134,17 @@ EOF - name: Test built package run: | echo "Testing built package..." - + # Find the package DEB_PACKAGE=$(ls *.deb 2>/dev/null | head -1) - + if [ -n "$DEB_PACKAGE" ]; then echo "✅ Found package: $DEB_PACKAGE" - + # Test package installation echo "Testing package installation..." dpkg -i "$DEB_PACKAGE" || echo "Installation test failed (this is normal for CI)" - + # Check if binary is accessible if which apt-ostree >/dev/null 2>&1; then echo "✅ apt-ostree installed successfully" @@ -216,7 +215,7 @@ EOF - name: Setup environment run: | apt update -y - + # Check if apt-cacher-ng is available if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then echo "✅ apt-cacher-ng is available, configuring proxy sources..." @@ -224,7 +223,7 @@ EOF echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list apt update -y else - echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." + echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." echo "deb http://deb.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list.d/standard.list echo "deb-src http://deb.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/standard.list apt update -y @@ -260,7 +259,7 @@ EOF - name: Setup environment run: | apt update -y - + # Check if apt-cacher-ng is available if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then echo "✅ apt-cacher-ng is available, configuring proxy sources..." @@ -268,7 +267,7 @@ EOF echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list apt update -y else - echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." + echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." echo "deb http://deb.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list.d/standard.list echo "deb-src http://deb.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list.d/standard.list apt update -y @@ -288,19 +287,19 @@ EOF - name: Validate package structure run: | echo "Validating package structure..." - + # Check for required files [ -f "Cargo.toml" ] && echo "✅ Cargo.toml found" || echo "❌ Cargo.toml missing" [ -d "debian" ] && echo "✅ debian/ directory found" || echo "❌ debian/ directory missing" - + if [ -d "debian" ]; then [ -f "debian/control" ] && echo "✅ debian/control found" || echo "❌ debian/control missing" [ -f "debian/rules" ] && echo "✅ debian/rules found" || echo "❌ debian/rules missing" fi - + # Check Rust project [ -d "src" ] && echo "✅ src/ directory found" || echo "❌ src/ directory missing" - + echo "Package validation completed!" - name: Create package summary @@ -339,7 +338,7 @@ EOF echo "- **Container**: rust:slim-trixie" >> STATUS_REPORT.md echo "" >> STATUS_REPORT.md echo "All CI jobs completed successfully! 🎉" >> STATUS_REPORT.md - + echo "Status report created: STATUS_REPORT.md" echo "✅ All CI jobs completed successfully!"