Skip to content

Commit 9c14bd4

Browse files
committed
1st test
1 parent dbd4b31 commit 9c14bd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+11304
-134
lines changed

.github/workflows/README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains the CI/CD workflows for the PPPwn Live ISO project.
4+
5+
## Workflows Overview
6+
7+
### 1. `ci.yml` - Continuous Integration
8+
**Triggers**: Push/PR to main/develop branches with changes to relevant paths
9+
- Detects changes in different components (stage1, stage2, configs, etc.)
10+
- Validates payload files and configurations
11+
- Triggers builds only when necessary
12+
- Provides detailed change summaries
13+
14+
### 2. `build.yml` - Build PPPwn Live ISO
15+
**Triggers**: Called by other workflows or manual dispatch
16+
- Fetches Buildroot from external repository
17+
- Implements comprehensive caching strategy
18+
- Builds the ISO with specified configuration
19+
- Uploads build artifacts
20+
- Supports matrix builds for different configurations
21+
22+
### 3. `release.yml` - Create Release
23+
**Triggers**: Push to main branch or manual dispatch
24+
- Builds ISO for release
25+
- Generates version numbers automatically
26+
- Creates GitHub releases with proper assets
27+
- Includes checksums and build information
28+
- Supports both automatic and manual versioning
29+
30+
### 4. `status-report.yml` - Build Status Report
31+
**Triggers**: Completion of other workflows
32+
- Reports build status and results
33+
- Creates issues for build failures
34+
- Closes issues when builds are fixed
35+
- Updates build status information
36+
37+
### 5. `manual-build.yml` - Manual Build and Upload
38+
**Triggers**: Manual dispatch only
39+
- Allows manual builds with custom parameters
40+
- Supports both artifact and release uploads
41+
- Provides flexible configuration options
42+
43+
## Caching Strategy
44+
45+
The workflows implement a multi-level caching strategy:
46+
47+
1. **Buildroot Source Cache**: Caches the Buildroot repository clone
48+
2. **Download Cache**: Caches downloaded packages and sources
49+
3. **Build Artifact Cache**: Caches compiled objects and build outputs
50+
51+
## Build Triggers
52+
53+
Builds are automatically triggered when changes are made to:
54+
- `br2-external/**` - Buildroot external tree
55+
- `configs/**` - Build configurations
56+
- `stage1/**` - PPPwn stage1 payloads
57+
- `stage2/**` - PPPwn stage2 payloads
58+
- `old_pppwnlive/**` - Legacy scripts and configurations
59+
- `.github/workflows/**` - Workflow definitions
60+
61+
## Artifacts and Releases
62+
63+
### Artifacts
64+
- Build artifacts are uploaded for every successful build
65+
- Includes ISO file and build information
66+
- Retained for 30 days (90 days for releases)
67+
68+
### Releases
69+
- Automatic releases on main branch pushes
70+
- Manual releases via workflow dispatch
71+
- Includes ISO, checksums, and build information
72+
- Proper semantic versioning support
73+
74+
## Usage
75+
76+
### Automatic Builds
77+
Simply push changes to the main or develop branch. The CI system will:
78+
1. Detect what changed
79+
2. Validate the changes
80+
3. Build if necessary
81+
4. Create releases (main branch only)
82+
83+
### Manual Builds
84+
Use the "Manual Build and Upload" workflow:
85+
1. Go to Actions tab
86+
2. Select "Manual Build and Upload"
87+
3. Click "Run workflow"
88+
4. Configure build parameters
89+
5. Run the build
90+
91+
### Monitoring
92+
- Check the Actions tab for build status
93+
- Build failures automatically create issues
94+
- Status reports provide detailed information
95+
- Workflow summaries show change detection results
96+
97+
## Configuration
98+
99+
### Environment Variables
100+
- `BUILDROOT_VERSION`: Buildroot version to use (default: 2025.05)
101+
- `BUILDROOT_REPO`: Buildroot repository URL
102+
103+
### Secrets
104+
- `GITHUB_TOKEN`: Automatically provided by GitHub Actions
105+
- No additional secrets required for basic functionality
106+
107+
## Troubleshooting
108+
109+
### Build Failures
110+
1. Check the workflow logs for detailed error information
111+
2. Verify Buildroot configuration is valid
112+
3. Ensure all required files are present
113+
4. Check for syntax errors in overlay scripts
114+
115+
### Cache Issues
116+
If builds are failing due to cache corruption:
117+
1. Go to Actions → Caches
118+
2. Delete relevant caches
119+
3. Re-run the workflow
120+
121+
### Release Issues
122+
- Ensure proper permissions for creating releases
123+
- Check that version numbers are unique
124+
- Verify all required files are present

.github/workflows/build.yml

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
name: Build PPPwn Live ISO
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
config:
7+
description: 'Buildroot configuration to use'
8+
required: false
9+
default: 'pppwn_defconfig'
10+
type: string
11+
architecture:
12+
description: 'Target architecture'
13+
required: false
14+
default: 'x86_64'
15+
type: string
16+
upload-artifacts:
17+
description: 'Whether to upload build artifacts'
18+
required: false
19+
default: true
20+
type: boolean
21+
workflow_dispatch:
22+
inputs:
23+
config:
24+
description: 'Buildroot configuration to use'
25+
required: false
26+
default: 'pppwn_defconfig'
27+
type: choice
28+
options:
29+
- pppwn_defconfig
30+
architecture:
31+
description: 'Target architecture'
32+
required: false
33+
default: 'x86_64'
34+
type: choice
35+
options:
36+
- x86_64
37+
upload-artifacts:
38+
description: 'Upload build artifacts'
39+
required: false
40+
default: true
41+
type: boolean
42+
43+
env:
44+
BUILDROOT_VERSION: "2025.05"
45+
BUILDROOT_REPO: "https://github.com/buildroot/buildroot"
46+
47+
jobs:
48+
build:
49+
runs-on: ubuntu-latest
50+
strategy:
51+
matrix:
52+
config: [${{ inputs.config || 'pppwn_defconfig' }}]
53+
architecture: [${{ inputs.architecture || 'x86_64' }}]
54+
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
58+
with:
59+
submodules: recursive
60+
fetch-depth: 0
61+
62+
- name: Install build dependencies
63+
run: |
64+
sudo apt-get update
65+
sudo apt-get install -y \
66+
build-essential \
67+
libncurses5-dev \
68+
rsync \
69+
bc \
70+
wget \
71+
cpio \
72+
python3 \
73+
unzip \
74+
file \
75+
git \
76+
cmake \
77+
ninja-build \
78+
pkg-config \
79+
libtool \
80+
autoconf \
81+
automake \
82+
gettext \
83+
bison \
84+
flex \
85+
texinfo \
86+
help2man \
87+
gawk \
88+
libtool-bin \
89+
libglib2.0-dev \
90+
libfdt-dev \
91+
libpixman-1-dev \
92+
zlib1g-dev \
93+
libnfs-dev \
94+
libiscsi-dev
95+
96+
- name: Cache Buildroot source
97+
id: cache-buildroot
98+
uses: actions/cache@v4
99+
with:
100+
path: buildroot
101+
key: buildroot-${{ env.BUILDROOT_VERSION }}-${{ hashFiles('.github/workflows/build.yml') }}
102+
restore-keys: |
103+
buildroot-${{ env.BUILDROOT_VERSION }}-
104+
105+
- name: Clone Buildroot
106+
if: steps.cache-buildroot.outputs.cache-hit != 'true'
107+
run: |
108+
git clone --depth 1 --branch ${{ env.BUILDROOT_VERSION }} ${{ env.BUILDROOT_REPO }} buildroot
109+
110+
- name: Cache Buildroot downloads
111+
uses: actions/cache@v4
112+
with:
113+
path: buildroot/dl
114+
key: buildroot-dl-${{ hashFiles('br2-external/package/*/**.mk', 'br2-external/package/*/**.hash') }}
115+
restore-keys: |
116+
buildroot-dl-
117+
118+
- name: Cache Buildroot build artifacts
119+
uses: actions/cache@v4
120+
with:
121+
path: |
122+
buildroot/output/build
123+
buildroot/output/host
124+
key: buildroot-build-${{ matrix.config }}-${{ matrix.architecture }}-${{ hashFiles('br2-external/**', 'configs/**') }}
125+
restore-keys: |
126+
buildroot-build-${{ matrix.config }}-${{ matrix.architecture }}-
127+
buildroot-build-${{ matrix.config }}-
128+
buildroot-build-
129+
130+
- name: Configure Buildroot
131+
run: |
132+
cd buildroot
133+
make BR2_EXTERNAL=../br2-external ${{ matrix.config }}
134+
135+
- name: Build system
136+
run: |
137+
cd buildroot
138+
make -j$(nproc)
139+
140+
- name: Verify build artifacts
141+
run: |
142+
cd buildroot
143+
ls -la output/images/
144+
if [ ! -f output/images/rootfs.iso9660 ]; then
145+
echo "Error: ISO image not found"
146+
exit 1
147+
fi
148+
149+
# Rename ISO to more descriptive name
150+
mv output/images/rootfs.iso9660 output/images/pppwn-live-${{ matrix.architecture }}.iso
151+
152+
# Check ISO size (should be reasonable for a minimal system)
153+
ISO_SIZE=$(stat -c%s output/images/pppwn-live-${{ matrix.architecture }}.iso)
154+
echo "ISO size: $((ISO_SIZE / 1024 / 1024)) MB"
155+
156+
if [ $ISO_SIZE -gt 1073741824 ]; then # 1GB limit
157+
echo "Warning: ISO size is larger than expected"
158+
fi
159+
160+
# Verify ISO can be mounted (basic integrity check)
161+
mkdir -p /tmp/iso_test
162+
sudo mount -o loop output/images/pppwn-live-${{ matrix.architecture }}.iso /tmp/iso_test || {
163+
echo "Error: ISO cannot be mounted"
164+
exit 1
165+
}
166+
sudo umount /tmp/iso_test
167+
168+
- name: Generate build info
169+
run: |
170+
cd buildroot
171+
echo "Build Information" > ../build-info.txt
172+
echo "=================" >> ../build-info.txt
173+
echo "Build Date: $(date -u)" >> ../build-info.txt
174+
echo "Buildroot Version: ${{ env.BUILDROOT_VERSION }}" >> ../build-info.txt
175+
echo "Configuration: ${{ matrix.config }}" >> ../build-info.txt
176+
echo "Architecture: ${{ matrix.architecture }}" >> ../build-info.txt
177+
echo "Commit SHA: ${{ github.sha }}" >> ../build-info.txt
178+
echo "Branch: ${{ github.ref_name }}" >> ../build-info.txt
179+
echo "" >> ../build-info.txt
180+
echo "Package Versions:" >> ../build-info.txt
181+
echo "=================" >> ../build-info.txt
182+
make show-info >> ../build-info.txt 2>/dev/null || echo "Package info not available" >> ../build-info.txt
183+
184+
- name: Upload build artifacts
185+
if: ${{ inputs.upload-artifacts != false }}
186+
uses: actions/upload-artifact@v4
187+
with:
188+
name: pppwn-live-iso-${{ matrix.config }}-${{ matrix.architecture }}-${{ github.sha }}
189+
path: |
190+
buildroot/output/images/pppwn-live-${{ matrix.architecture }}.iso
191+
build-info.txt
192+
retention-days: 30
193+
194+
- name: Upload build logs on failure
195+
if: failure()
196+
uses: actions/upload-artifact@v4
197+
with:
198+
name: build-logs-${{ matrix.config }}-${{ matrix.architecture }}-${{ github.sha }}
199+
path: |
200+
buildroot/output/build/build-time.log
201+
buildroot/output/build/packages-file-list.txt
202+
retention-days: 7

0 commit comments

Comments
 (0)