From 2f6b1b5c714c858885bb685984e7e07345fcc758 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:37:10 +0000 Subject: [PATCH 1/5] Initial plan From 7ee917b39d6dbc0ed50600766d7aee782405f2a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:40:42 +0000 Subject: [PATCH 2/5] Add CI/CD workflow for compiled release zip Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .github/workflows/release.yml | 224 ++++++++++++++++++++++++++++++++++ .gitignore | 2 + 2 files changed, 226 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3c1926d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,224 @@ +name: Build and Release + +on: + push: + branches: + - main + - develop + tags: + - 'v*' + pull_request: + branches: + - main + - develop + workflow_dispatch: + +jobs: + build-release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up build environment + run: | + sudo apt-get update + sudo apt-get install -y gcc make + + - name: Build init binary + run: | + echo "Building SparkOS init system..." + make init + echo "Build complete!" + + - name: Verify build + run: | + echo "Verifying init binary..." + if [ ! -f init ]; then + echo "ERROR: init binary not found!" + exit 1 + fi + ls -lh init + file init + ldd init 2>&1 || echo "Static binary (no dependencies)" + echo "Verification complete!" + + - name: Prepare release package + run: | + echo "Preparing release package..." + mkdir -p release/sparkos + + # Copy compiled binary + cp init release/sparkos/ + + # Copy essential files + cp README.md release/sparkos/ + cp LICENSE release/sparkos/ + cp ARCHITECTURE.md release/sparkos/ + cp CONTRIBUTING.md release/sparkos/ + cp Makefile release/sparkos/ + + # Copy source for reference + cp -r src release/sparkos/ + + # Copy scripts + cp -r scripts release/sparkos/ + + # Copy config + cp -r config release/sparkos/ + + # Copy rootfs structure (without generated content) + mkdir -p release/sparkos/rootfs + cp -r rootfs/etc release/sparkos/rootfs/ 2>/dev/null || true + cp -r rootfs/root release/sparkos/rootfs/ 2>/dev/null || true + cp -r rootfs/home release/sparkos/rootfs/ 2>/dev/null || true + + # Create README for the release + cat > release/sparkos/RELEASE_README.md << 'EOF' +# SparkOS Release Package + +This package contains the compiled SparkOS init system and all necessary files to run or build SparkOS. + +## Contents + +- `init` - The compiled init binary (statically linked) +- `src/` - Source code for the init system +- `scripts/` - Build and setup scripts +- `config/` - Configuration files +- `rootfs/` - Root filesystem structure +- `Makefile` - Build system +- Documentation files (README.md, ARCHITECTURE.md, etc.) + +## Quick Start + +### Using the Pre-built Binary + +The `init` binary is already compiled and ready to use: + +```bash +# Copy to your rootfs +cp init /path/to/your/rootfs/sbin/init +chmod 755 /path/to/your/rootfs/sbin/init +``` + +### Rebuilding from Source + +If you need to rebuild: + +```bash +# Build the init system +make init + +# Install to rootfs +make install +``` + +### Creating a Bootable System + +Follow the instructions in README.md to create a complete bootable system. + +## System Requirements + +- Linux system with kernel 3.x or later +- Busybox for shell and utilities +- For building: GCC compiler, Make + +## Documentation + +See README.md for complete documentation, including: +- Building instructions +- Creating bootable images +- Network configuration +- Development guidelines + +## Support + +For issues and questions, visit: https://github.com/johndoe6345789/SparkOS +EOF + + echo "Package prepared in release/sparkos/" + ls -la release/sparkos/ + + - name: Create release archive + run: | + echo "Creating release archive..." + cd release + zip -r ../sparkos-release.zip sparkos/ + cd .. + echo "Archive created!" + ls -lh sparkos-release.zip + unzip -l sparkos-release.zip | head -30 + + - name: Upload release artifact + uses: actions/upload-artifact@v4 + with: + name: sparkos-release-${{ github.sha }} + path: sparkos-release.zip + retention-days: 90 + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: sparkos-release.zip + body: | + # SparkOS Release ${{ github.ref_name }} + + This release includes: + - Pre-compiled init binary (statically linked) + - Complete source code + - Build scripts and configuration + - Root filesystem structure + - Documentation + + ## Quick Start + + 1. Download `sparkos-release.zip` + 2. Extract the archive + 3. Use the pre-built `init` binary or rebuild from source + 4. Follow README.md for complete setup instructions + + ## Docker Image + + A Docker image is also available: + ```bash + docker pull ghcr.io/johndoe6345789/sparkos:${{ github.ref_name }} + ``` + + ## What's Changed + + See commit history for detailed changes. + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Output summary + run: | + echo "### Build and Release Summary 📦" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Status:** ✅ Success" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Init Binary:**" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + ls -lh init >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Release Archive:**" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + ls -lh sparkos-release.zip >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "**Release:** Created GitHub release for ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY + else + echo "**Artifact:** Uploaded as workflow artifact (available for 90 days)" >> $GITHUB_STEP_SUMMARY + fi + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Archive Contents (preview):**" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + unzip -l sparkos-release.zip | head -30 >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.gitignore b/.gitignore index 7555bc7..a74c60b 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ build/ init *.img *.iso +*.zip +release/ # Temporary files /tmp/ From f192f35dd1d33fe92fe4c7dc4d5befa37e61d5ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:42:07 +0000 Subject: [PATCH 3/5] Update README with release workflow documentation Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4c209b..80b3319 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ The current MVP provides: - ✅ Docker container for testing - ✅ Automated builds and publishing to GHCR - ✅ Multi-architecture Docker images (AMD64 and ARM64) +- ✅ CI/CD pipeline for compiled release packages +- ✅ GitHub releases with pre-built binaries ## Prerequisites @@ -43,6 +45,32 @@ To create bootable images (optional): ## Quick Start +### Using Pre-built Releases (Easiest) + +Download the latest release package from the [GitHub Releases page](https://github.com/johndoe6345789/SparkOS/releases): + +```bash +# Download the latest release (replace VERSION with actual version, e.g., v1.0.0) +wget https://github.com/johndoe6345789/SparkOS/releases/download/VERSION/sparkos-release.zip + +# Extract the package +unzip sparkos-release.zip +cd sparkos/ + +# The init binary is already compiled and ready to use +ls -lh init + +# Copy to your rootfs or use directly +cp init /path/to/your/rootfs/sbin/init +``` + +The release package includes: +- Pre-compiled init binary (statically linked, ready to use) +- Complete source code +- Build scripts and configuration +- Root filesystem structure +- Full documentation + ### Using Docker (Recommended for Testing) The easiest way to test SparkOS is using the pre-built Docker image from GitHub Container Registry: @@ -187,10 +215,17 @@ SparkOS uses GitHub Actions for continuous integration and delivery: **Automated Builds:** - Docker images are automatically built on every push to main/develop branches -- Images are also built for pull requests (testing only, not published) -- Tagged releases automatically create versioned Docker images +- Compiled release packages are automatically built on every push to main/develop branches +- Images and releases are also built for pull requests (testing only, not published) +- Tagged releases automatically create versioned Docker images and GitHub releases with compiled binaries - **Multi-architecture builds**: Images are built for both AMD64 (x86_64) and ARM64 (aarch64) +**Compiled Releases:** +- Pre-compiled init binaries are available as GitHub releases for version tags +- Release packages include: compiled init binary, source code, build scripts, and documentation +- Download releases from the [GitHub Releases page](https://github.com/johndoe6345789/SparkOS/releases) +- Build artifacts are available for all workflow runs (retained for 90 days) + **Container Registry:** - Images are published to GitHub Container Registry (GHCR) - Pull images: `docker pull ghcr.io/johndoe6345789/sparkos:latest` From 8684045f7edaf3f894cc84572b3a8691131a36e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:43:26 +0000 Subject: [PATCH 4/5] Address code review feedback: improve error handling and grammar Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .github/workflows/release.yml | 11 ++++++++--- README.md | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c1926d..e961bb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,9 +72,14 @@ jobs: # Copy rootfs structure (without generated content) mkdir -p release/sparkos/rootfs - cp -r rootfs/etc release/sparkos/rootfs/ 2>/dev/null || true - cp -r rootfs/root release/sparkos/rootfs/ 2>/dev/null || true - cp -r rootfs/home release/sparkos/rootfs/ 2>/dev/null || true + # Copy rootfs directories if they exist (some may not be populated) + for dir in etc root home; do + if [ -d "rootfs/$dir" ]; then + cp -r "rootfs/$dir" release/sparkos/rootfs/ + else + echo "Note: rootfs/$dir does not exist, skipping" + fi + done # Create README for the release cat > release/sparkos/RELEASE_README.md << 'EOF' diff --git a/README.md b/README.md index 80b3319..58921a0 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ SparkOS uses GitHub Actions for continuous integration and delivery: **Automated Builds:** - Docker images are automatically built on every push to main/develop branches - Compiled release packages are automatically built on every push to main/develop branches -- Images and releases are also built for pull requests (testing only, not published) +- Both are also built for pull requests (testing only, not published) - Tagged releases automatically create versioned Docker images and GitHub releases with compiled binaries - **Multi-architecture builds**: Images are built for both AMD64 (x86_64) and ARM64 (aarch64) From 323559a9a6436d17b044b5c130850d25a7b1a4d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 18:46:14 +0000 Subject: [PATCH 5/5] Fix YAML syntax in release workflow Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .github/workflows/release.yml | 122 +++++++++++++++++----------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e961bb4..4724390 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,67 +82,67 @@ jobs: done # Create README for the release - cat > release/sparkos/RELEASE_README.md << 'EOF' -# SparkOS Release Package - -This package contains the compiled SparkOS init system and all necessary files to run or build SparkOS. - -## Contents - -- `init` - The compiled init binary (statically linked) -- `src/` - Source code for the init system -- `scripts/` - Build and setup scripts -- `config/` - Configuration files -- `rootfs/` - Root filesystem structure -- `Makefile` - Build system -- Documentation files (README.md, ARCHITECTURE.md, etc.) - -## Quick Start - -### Using the Pre-built Binary - -The `init` binary is already compiled and ready to use: - -```bash -# Copy to your rootfs -cp init /path/to/your/rootfs/sbin/init -chmod 755 /path/to/your/rootfs/sbin/init -``` - -### Rebuilding from Source - -If you need to rebuild: - -```bash -# Build the init system -make init - -# Install to rootfs -make install -``` - -### Creating a Bootable System - -Follow the instructions in README.md to create a complete bootable system. - -## System Requirements - -- Linux system with kernel 3.x or later -- Busybox for shell and utilities -- For building: GCC compiler, Make - -## Documentation - -See README.md for complete documentation, including: -- Building instructions -- Creating bootable images -- Network configuration -- Development guidelines - -## Support - -For issues and questions, visit: https://github.com/johndoe6345789/SparkOS -EOF + cat > release/sparkos/RELEASE_README.md << 'HEREDOC_EOF' + # SparkOS Release Package + + This package contains the compiled SparkOS init system and all necessary files to run or build SparkOS. + + ## Contents + + - \`init\` - The compiled init binary (statically linked) + - \`src/\` - Source code for the init system + - \`scripts/\` - Build and setup scripts + - \`config/\` - Configuration files + - \`rootfs/\` - Root filesystem structure + - \`Makefile\` - Build system + - Documentation files (README.md, ARCHITECTURE.md, etc.) + + ## Quick Start + + ### Using the Pre-built Binary + + The \`init\` binary is already compiled and ready to use: + + \`\`\`bash + # Copy to your rootfs + cp init /path/to/your/rootfs/sbin/init + chmod 755 /path/to/your/rootfs/sbin/init + \`\`\` + + ### Rebuilding from Source + + If you need to rebuild: + + \`\`\`bash + # Build the init system + make init + + # Install to rootfs + make install + \`\`\` + + ### Creating a Bootable System + + Follow the instructions in README.md to create a complete bootable system. + + ## System Requirements + + - Linux system with kernel 3.x or later + - Busybox for shell and utilities + - For building: GCC compiler, Make + + ## Documentation + + See README.md for complete documentation, including: + - Building instructions + - Creating bootable images + - Network configuration + - Development guidelines + + ## Support + + For issues and questions, visit: https://github.com/johndoe6345789/SparkOS + HEREDOC_EOF echo "Package prepared in release/sparkos/" ls -la release/sparkos/