Some checks failed
Build libostree Backport / Build libostree Backport (push) Failing after 10m14s
- Replace artifact upload with Debian Package Registry integration - Add automatic package upload to Forgejo's native Debian repository - Update README with apt repository installation instructions - Provide multiple download methods: apt repo, direct download, and artifacts - Enable users to install packages via standard apt commands - Improve package distribution with version control and deduplication This change transforms the package distribution from manual artifact downloads to a professional Debian repository that users can add to their apt sources.
159 lines
No EOL
6 KiB
YAML
159 lines
No EOL
6 KiB
YAML
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
|
|
|
|
- name: Upload to Debian Package Registry
|
|
run: |
|
|
# Upload each .deb package to Forgejo's Debian Package Registry
|
|
for deb_file in release-assets/*.deb; do
|
|
if [ -f "$deb_file" ]; then
|
|
echo "Uploading $deb_file to Debian Package Registry..."
|
|
# Extract package name and version
|
|
pkg_name=$(dpkg-deb -f "$deb_file" Package)
|
|
pkg_version=$(dpkg-deb -f "$deb_file" Version)
|
|
pkg_arch=$(dpkg-deb -f "$deb_file" Architecture)
|
|
|
|
echo "Package: $pkg_name"
|
|
echo "Version: $pkg_version"
|
|
echo "Architecture: $pkg_arch"
|
|
|
|
# Upload to Forgejo's Debian Package Registry
|
|
# This will be available at: https://git.raines.xyz/api/packages/robojerk/debian
|
|
curl -X POST \
|
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
-H "Content-Type: application/vnd.debian.binary-package" \
|
|
--data-binary "@$deb_file" \
|
|
"https://git.raines.xyz/api/packages/robojerk/debian/$pkg_name/$pkg_version/$pkg_arch"
|
|
fi
|
|
done |