Initial commit: Complete bootc packaging with CI/CD automation
Some checks failed
Build Packages / Build libostree Backport (push) Failing after 0s
Build Packages / Build bootc Package (push) Has been skipped
Test Build / Test bootc Build (with existing libostree) (push) Failing after 0s
Build Packages / Create Release (push) Has been skipped
Build Packages / Create Artifacts for README Update (push) Has been skipped
Some checks failed
Build Packages / Build libostree Backport (push) Failing after 0s
Build Packages / Build bootc Package (push) Has been skipped
Test Build / Test bootc Build (with existing libostree) (push) Failing after 0s
Build Packages / Create Release (push) Has been skipped
Build Packages / Create Artifacts for README Update (push) Has been skipped
This commit is contained in:
commit
695714a60e
15 changed files with 1545 additions and 0 deletions
172
.forgejo/workflows/build-packages.yml
Normal file
172
.forgejo/workflows/build-packages.yml
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
name: Build Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
env:
|
||||
UBUNTU_VERSION: "24.04"
|
||||
OSTREE_VERSION: "2025.2"
|
||||
BOOTC_VERSION: "1.5.1"
|
||||
BACKPORT_SUFFIX: "~noble1"
|
||||
|
||||
jobs:
|
||||
build-libostree-backport:
|
||||
name: Build libostree Backport
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup build environment
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y devscripts build-essential wget
|
||||
|
||||
- name: Add source repositories
|
||||
run: |
|
||||
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ noble main universe" | sudo tee /etc/apt/sources.list.d/noble-sources.list
|
||||
sudo apt update
|
||||
|
||||
- name: Create backport directory
|
||||
run: |
|
||||
mkdir -p /opt/Projects/ostree-backport-noble
|
||||
cd /opt/Projects/ostree-backport-noble
|
||||
|
||||
- name: Download libostree source
|
||||
run: |
|
||||
cd /opt/Projects/ostree-backport-noble
|
||||
POOL_URL="http://archive.ubuntu.com/ubuntu/pool/universe/o/ostree/"
|
||||
wget "${POOL_URL}ostree_${OSTREE_VERSION}-1.dsc"
|
||||
wget "${POOL_URL}ostree_${OSTREE_VERSION}.orig.tar.xz"
|
||||
wget "${POOL_URL}ostree_${OSTREE_VERSION}-1.debian.tar.xz"
|
||||
|
||||
- name: Extract and modify source
|
||||
run: |
|
||||
cd /opt/Projects/ostree-backport-noble
|
||||
dpkg-source -x "ostree_${OSTREE_VERSION}-1.dsc"
|
||||
cd "ostree-${OSTREE_VERSION}"
|
||||
dch --newversion "${OSTREE_VERSION}-1${BACKPORT_SUFFIX}" \
|
||||
--distribution "noble-backports" \
|
||||
-b \
|
||||
"Backport libostree ${OSTREE_VERSION}-1 from Ubuntu questing for bootc compatibility."
|
||||
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
cd /opt/Projects/ostree-backport-noble/ostree-${OSTREE_VERSION}
|
||||
sudo apt build-dep ./
|
||||
|
||||
- name: Build libostree backport
|
||||
run: |
|
||||
cd /opt/Projects/ostree-backport-noble/ostree-${OSTREE_VERSION}
|
||||
dpkg-buildpackage -us -uc -b
|
||||
|
||||
- name: Upload libostree artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: libostree-backport-packages
|
||||
path: /opt/Projects/ostree-backport-noble/*.deb
|
||||
retention-days: 30
|
||||
|
||||
build-bootc:
|
||||
name: Build bootc Package
|
||||
runs-on: ubuntu-24.04
|
||||
needs: build-libostree-backport
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download libostree artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: libostree-backport-packages
|
||||
path: /tmp/libostree-packages
|
||||
|
||||
- name: Install libostree backport
|
||||
run: |
|
||||
sudo dpkg -i /tmp/libostree-packages/*.deb || true
|
||||
sudo apt --fix-broken install -y
|
||||
|
||||
- name: Setup build environment
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git cargo rustc pkg-config build-essential
|
||||
|
||||
- name: Clone bootc source
|
||||
run: |
|
||||
git clone --depth 1 --branch v${BOOTC_VERSION} https://github.com/containers/bootc.git bootc-${BOOTC_VERSION}
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
|
||||
- name: Apply compatibility patch
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
patch -p1 < ../bootc-libostree-compatibility.patch
|
||||
|
||||
- name: Copy debian packaging
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
cp -r ../debian .
|
||||
|
||||
- name: Build bootc package
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
dpkg-buildpackage -us -uc -b
|
||||
|
||||
- name: Upload bootc artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bootc-packages
|
||||
path: bootc-${BOOTC_VERSION}/../*.deb
|
||||
retention-days: 30
|
||||
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build-libostree-backport, build-bootc]
|
||||
if: github.event_name == 'release'
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/artifacts
|
||||
|
||||
- name: Create release assets
|
||||
run: |
|
||||
mkdir -p release-assets
|
||||
cp /tmp/artifacts/libostree-backport-packages/*.deb release-assets/
|
||||
cp /tmp/artifacts/bootc-packages/*.deb release-assets/
|
||||
|
||||
- name: Upload release assets
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-assets
|
||||
path: release-assets/
|
||||
retention-days: 90
|
||||
|
||||
create-artifacts-for-readme:
|
||||
name: Create Artifacts for README Update
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build-libostree-backport, build-bootc]
|
||||
if: github.event_name != 'release'
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/artifacts
|
||||
|
||||
- name: Create combined artifacts
|
||||
run: |
|
||||
mkdir -p release-assets
|
||||
cp /tmp/artifacts/libostree-backport-packages/*.deb release-assets/ 2>/dev/null || true
|
||||
cp /tmp/artifacts/bootc-packages/*.deb release-assets/ 2>/dev/null || true
|
||||
|
||||
- name: Upload combined artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-assets
|
||||
path: release-assets/
|
||||
retention-days: 30
|
||||
27
.forgejo/workflows/config.yml
Normal file
27
.forgejo/workflows/config.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Forgejo Actions Configuration
|
||||
# This file configures the CI/CD environment for building bootc and libostree packages
|
||||
|
||||
# Enable Actions
|
||||
actions:
|
||||
enabled: true
|
||||
|
||||
# Default runner settings
|
||||
runners:
|
||||
# Use Ubuntu 24.04 for all builds
|
||||
ubuntu-24.04:
|
||||
image: ubuntu:24.04
|
||||
# Enable sudo for package installation
|
||||
privileged: true
|
||||
|
||||
# Workflow settings
|
||||
workflows:
|
||||
# Allow manual workflow triggers
|
||||
manual_trigger: true
|
||||
|
||||
# Enable workflow reuse
|
||||
reusable_workflows: true
|
||||
|
||||
# Artifact retention settings
|
||||
artifacts:
|
||||
retention_days: 30
|
||||
max_size_mb: 1000
|
||||
58
.forgejo/workflows/test-build.yml
Normal file
58
.forgejo/workflows/test-build.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
name: Test Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
env:
|
||||
BOOTC_VERSION: "1.5.1"
|
||||
|
||||
jobs:
|
||||
test-bootc-build:
|
||||
name: Test bootc Build (with existing libostree)
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup build environment
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git cargo rustc pkg-config build-essential
|
||||
|
||||
- name: Check libostree version
|
||||
run: |
|
||||
pkg-config --modversion ostree-1 || echo "libostree not found"
|
||||
dpkg -l | grep libostree || echo "No libostree packages installed"
|
||||
|
||||
- name: Clone bootc source
|
||||
run: |
|
||||
git clone --depth 1 --branch v${BOOTC_VERSION} https://github.com/containers/bootc.git bootc-${BOOTC_VERSION}
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
|
||||
- name: Apply compatibility patch
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
patch -p1 < ../bootc-libostree-compatibility.patch
|
||||
|
||||
- name: Copy debian packaging
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
cp -r ../debian .
|
||||
|
||||
- name: Test cargo build
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
cargo build --release
|
||||
|
||||
- name: Test package build (if libostree available)
|
||||
run: |
|
||||
cd bootc-${BOOTC_VERSION}
|
||||
if pkg-config --exists ostree-1; then
|
||||
dpkg-buildpackage -us -uc -b
|
||||
echo "Package build successful"
|
||||
else
|
||||
echo "Skipping package build - libostree not available"
|
||||
fi
|
||||
175
.forgejo/workflows/update-readme.yml
Normal file
175
.forgejo/workflows/update-readme.yml
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
name: Update README with Download Links
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build Packages"]
|
||||
types: [completed]
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
update-readme:
|
||||
name: Update README with Artifact Links
|
||||
runs-on: ubuntu-24.04
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download artifacts from previous workflow
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-assets
|
||||
path: /tmp/artifacts
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Generate download links
|
||||
run: |
|
||||
python3 << 'EOF'
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
# Get artifact files
|
||||
artifact_dir = "/tmp/artifacts"
|
||||
files = []
|
||||
if os.path.exists(artifact_dir):
|
||||
for file in os.listdir(artifact_dir):
|
||||
if file.endswith('.deb'):
|
||||
files.append(file)
|
||||
|
||||
# Generate download links
|
||||
base_url = f"https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['GITHUB_RUN_ID']}/artifacts"
|
||||
|
||||
print("## 📦 Latest Packages")
|
||||
print()
|
||||
print("> **Note**: These packages are automatically built by CI/CD. For the latest version, check the [Actions tab](https://github.com/$GITHUB_REPOSITORY/actions).")
|
||||
print()
|
||||
|
||||
if files:
|
||||
print("### Download Links")
|
||||
print()
|
||||
print("| Package | Download |")
|
||||
print("|---------|----------|")
|
||||
|
||||
for file in sorted(files):
|
||||
if 'libostree' in file:
|
||||
package_name = "libostree Backport"
|
||||
elif 'bootc' in file:
|
||||
package_name = "bootc"
|
||||
else:
|
||||
package_name = file
|
||||
|
||||
print(f"| {package_name} | [{file}]({base_url}) |")
|
||||
|
||||
print()
|
||||
print("### Installation Instructions")
|
||||
print()
|
||||
print("```bash")
|
||||
print("# Download and install libostree backport first")
|
||||
print("wget <libostree-package-url>")
|
||||
print("sudo dpkg -i <libostree-package-name>.deb")
|
||||
print("sudo apt --fix-broken install -y")
|
||||
print()
|
||||
print("# Then install bootc")
|
||||
print("wget <bootc-package-url>")
|
||||
print("sudo dpkg -i <bootc-package-name>.deb")
|
||||
print("sudo apt --fix-broken install -y")
|
||||
print("```")
|
||||
print()
|
||||
print(f"*Last updated: {datetime.now().strftime('%Y-%m-%d %H:%M UTC')}*")
|
||||
else:
|
||||
print("No packages found in artifacts.")
|
||||
print()
|
||||
print("Check the [Actions tab](https://github.com/$GITHUB_REPOSITORY/actions) for build status.")
|
||||
EOF
|
||||
|
||||
# Save to file
|
||||
python3 << 'EOF' > /tmp/download_section.md
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
# Get artifact files
|
||||
artifact_dir = "/tmp/artifacts"
|
||||
files = []
|
||||
if os.path.exists(artifact_dir):
|
||||
for file in os.listdir(artifact_dir):
|
||||
if file.endswith('.deb'):
|
||||
files.append(file)
|
||||
|
||||
# Generate download links
|
||||
base_url = f"https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['GITHUB_RUN_ID']}/artifacts"
|
||||
|
||||
print("## 📦 Latest Packages")
|
||||
print()
|
||||
print("> **Note**: These packages are automatically built by CI/CD. For the latest version, check the [Actions tab](https://github.com/$GITHUB_REPOSITORY/actions).")
|
||||
print()
|
||||
|
||||
if files:
|
||||
print("### Download Links")
|
||||
print()
|
||||
print("| Package | Download |")
|
||||
print("|---------|----------|")
|
||||
|
||||
for file in sorted(files):
|
||||
if 'libostree' in file:
|
||||
package_name = "libostree Backport"
|
||||
elif 'bootc' in file:
|
||||
package_name = "bootc"
|
||||
else:
|
||||
package_name = file
|
||||
|
||||
print(f"| {package_name} | [{file}]({base_url}) |")
|
||||
|
||||
print()
|
||||
print("### Installation Instructions")
|
||||
print()
|
||||
print("```bash")
|
||||
print("# Download and install libostree backport first")
|
||||
print("wget <libostree-package-url>")
|
||||
print("sudo dpkg -i <libostree-package-name>.deb")
|
||||
print("sudo apt --fix-broken install -y")
|
||||
print()
|
||||
print("# Then install bootc")
|
||||
print("wget <bootc-package-url>")
|
||||
print("sudo dpkg -i <bootc-package-name>.deb")
|
||||
print("sudo apt --fix-broken install -y")
|
||||
print("```")
|
||||
print()
|
||||
print(f"*Last updated: {datetime.now().strftime('%Y-%m-%d %H:%M UTC')}*")
|
||||
else:
|
||||
print("No packages found in artifacts.")
|
||||
print()
|
||||
print("Check the [Actions tab](https://github.com/$GITHUB_REPOSITORY/actions) for build status.")
|
||||
EOF
|
||||
|
||||
- name: Update README
|
||||
run: |
|
||||
# Create backup
|
||||
cp README.md README.md.backup
|
||||
|
||||
# Find the download section in README
|
||||
if grep -q "## 📦 Latest Packages" README.md; then
|
||||
# Replace existing download section
|
||||
awk '/^## 📦 Latest Packages/{exit} {print}' README.md > README.md.tmp
|
||||
cat README.md.tmp /tmp/download_section.md > README.md
|
||||
rm README.md.tmp
|
||||
else
|
||||
# Add download section after the first section
|
||||
awk '/^## 🚀 Quick Start/{print; print ""; system("cat /tmp/download_section.md"); next} {print}' README.md > README.md.tmp
|
||||
mv README.md.tmp README.md
|
||||
fi
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add README.md
|
||||
git diff --quiet && git diff --staged --quiet || git commit -m "Update README with latest package download links [skip ci]"
|
||||
git push
|
||||
Loading…
Add table
Add a link
Reference in a new issue