Files
SparkOS/.github/workflows/release.yml
Workflow config file is invalid. Please check your config file: yaml: line 83: could not find expected ':'
2025-12-28 18:40:42 +00:00

225 lines
6.5 KiB
YAML

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