added files
All checks were successful
Build libostree Backport / Build libostree Backport (push) Successful in 9m19s

This commit is contained in:
robojerk 2025-07-21 03:08:18 +00:00
parent 141193e345
commit 46de31a373
4 changed files with 515 additions and 0 deletions

View file

@ -0,0 +1,134 @@
name: Build libostree Backport
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
env:
UBUNTU_VERSION: "24.04"
OSTREE_VERSION: "2025.2"
BACKPORT_SUFFIX: "~noble1"
jobs:
build-libostree-backport:
name: Build libostree Backport
runs-on: ubuntu-latest
container:
image: ubuntu:latest
steps:
- name: Setup build environment
run: |
apt update -y
apt install -y devscripts build-essential wget git
- name: Checkout repository manually
run: |
# Clone the repository manually instead of using actions/checkout
git clone https://git.raines.xyz/robojerk/libostree-dev.git /tmp/libostree-dev
cp -r /tmp/libostree-dev/* .
cp -r /tmp/libostree-dev/.* . 2>/dev/null || true
- name: Add source repositories
run: |
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ noble main universe" | tee /etc/apt/sources.list.d/noble-sources.list
apt update -y
- 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}
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get update
apt-get build-dep -y --no-install-recommends ./
- name: Build libostree backport
run: |
cd /opt/Projects/ostree-backport-noble/ostree-${OSTREE_VERSION}
dpkg-buildpackage -us -uc -b
- name: List built packages
run: |
echo "Built libostree packages:"
ls -la /opt/Projects/ostree-backport-noble/*.deb
- name: Create release assets
run: |
mkdir -p release-assets
cp /opt/Projects/ostree-backport-noble/*.deb release-assets/
# Create a summary file
echo "libostree Backport Build Summary" > release-assets/BUILD_SUMMARY.txt
echo "===============================" >> release-assets/BUILD_SUMMARY.txt
echo "Build Date: $(date)" >> release-assets/BUILD_SUMMARY.txt
echo "Ubuntu Version: ${UBUNTU_VERSION}" >> release-assets/BUILD_SUMMARY.txt
echo "Ostree Version: ${OSTREE_VERSION}" >> release-assets/BUILD_SUMMARY.txt
echo "Backport Suffix: ${BACKPORT_SUFFIX}" >> release-assets/BUILD_SUMMARY.txt
echo "" >> release-assets/BUILD_SUMMARY.txt
echo "Built Packages:" >> release-assets/BUILD_SUMMARY.txt
ls -la release-assets/*.deb 2>/dev/null || echo "No packages found" >> release-assets/BUILD_SUMMARY.txt
# Create package list for download links
echo "Package List:" > release-assets/PACKAGES.txt
ls -1 release-assets/*.deb 2>/dev/null | sed 's|.*/||' >> release-assets/PACKAGES.txt
echo "Release assets created:"
ls -la release-assets/
- name: Create download instructions
run: |
cat > release-assets/INSTALL.md << EOF
# libostree 2025.2-1 Backport Installation
## Quick Install
\`\`\`bash
# Download and install the main package
wget https://git.raines.xyz/robojerk/libostree-dev/actions/runs/\${{ github.run_id }}/artifacts
sudo dpkg -i libostree-dev_2025.2-1~noble1_amd64.deb
sudo apt-get install -f
\`\`\`
## Verification
\`\`\`bash
# Check if libostree 2025.2-1 is installed
pkg-config --modversion ostree-1
# Should output: 2025.2
\`\`\`
## Packages Included
EOF
ls -1 release-assets/*.deb 2>/dev/null | sed 's|.*/||' | while read package; do
echo "- \`$package\`" >> release-assets/INSTALL.md
done
echo "" >> release-assets/INSTALL.md
echo "Build completed on: $(date)" >> release-assets/INSTALL.md

View file

@ -0,0 +1,120 @@
name: Update README with Download Links
on:
workflow_run:
workflows: ["Build libostree Backport"]
types: [completed]
branches: [ main, master ]
jobs:
update-readme:
name: Update README with Download Links
runs-on: ubuntu-latest
container:
image: ubuntu:latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Setup environment
run: |
apt update -y
apt install -y git curl
- name: Checkout repository manually
run: |
# Clone the repository manually instead of using actions/checkout
git clone https://git.raines.xyz/robojerk/libostree-dev.git /tmp/libostree-dev
cp -r /tmp/libostree-dev/* .
cp -r /tmp/libostree-dev/.* . 2>/dev/null || true
- name: Get workflow run artifacts
run: |
# Get the workflow run ID from the triggering workflow
WORKFLOW_RUN_ID=${{ github.event.workflow_run.id }}
REPO_OWNER="robojerk"
REPO_NAME="libostree-dev"
echo "Workflow Run ID: $WORKFLOW_RUN_ID"
echo "Repository: $REPO_OWNER/$REPO_NAME"
# Create artifacts directory
mkdir -p artifacts
# Download artifacts from the workflow run
# Note: This is a placeholder - actual artifact download would depend on Forgejo API
echo "Downloading artifacts from workflow run $WORKFLOW_RUN_ID..."
# For now, we'll create a placeholder that shows the expected structure
echo "libostree-dev_2025.2-1~noble1_amd64.deb" > artifacts/package-list.txt
echo "libostree-dev-dbgsym_2025.2-1~noble1_amd64.ddeb" >> artifacts/package-list.txt
- name: Update README with download links
run: |
# Get current date
BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S UTC')
# Create download section
cat > download-section.md << EOF
## 📦 Download Latest Build
**Last Built**: $BUILD_DATE
**Version**: 2025.2-1~noble1
**Target**: Ubuntu Noble (24.04 LTS)
### Download Links
EOF
# Add download links for each package
if [ -f "artifacts/package-list.txt" ]; then
while IFS= read -r package; do
if [[ $package == *.deb ]]; then
echo "- **$package** - [Download](https://git.raines.xyz/robojerk/libostree-dev/actions/runs/\${{ github.event.workflow_run.id }}/artifacts)" >> download-section.md
fi
done < artifacts/package-list.txt
else
echo "- **libostree-dev_2025.2-1~noble1_amd64.deb** - [Download](https://git.raines.xyz/robojerk/libostree-dev/actions/runs/\${{ github.event.workflow_run.id }}/artifacts)" >> download-section.md
fi
cat >> download-section.md << EOF
### Installation
\`\`\`bash
# Download and install the package
wget https://git.raines.xyz/robojerk/libostree-dev/actions/runs/\${{ github.event.workflow_run.id }}/artifacts
sudo dpkg -i libostree-dev_2025.2-1~noble1_amd64.deb
sudo apt-get install -f # Install any missing dependencies
\`\`\`
### Verification
\`\`\`bash
# Check if libostree 2025.2-1 is installed
pkg-config --modversion ostree-1
# Should output: 2025.2
\`\`\`
---
EOF
# Update the README
# Find the line after the main description and insert the download section
awk '/## Usage/{print; system("cat download-section.md"); next} 1' README.md > README.md.tmp
mv README.md.tmp README.md
echo "README updated with download links"
- name: Commit and push changes
run: |
# Configure git
git config --global user.email "ci@raines.xyz"
git config --global user.name "CI Bot"
# Add and commit changes
git add README.md
git commit -m "Update README with download links from workflow run ${{ github.event.workflow_run.id }}"
# Push changes
git push origin main