Simplify CI/CD workflows for Forgejo compatibility
Some checks failed
Build Packages / Build libostree Backport (push) Failing after 0s
Build Packages / Build bootc Package (push) Has been skipped
Build Packages / Create Combined Artifacts (push) Has been skipped
Test Build / Test bootc Build (with existing libostree) (push) Failing after 0s

This commit is contained in:
robojerk 2025-07-20 23:34:40 +00:00
parent 695714a60e
commit 4a9c19ef1c
3 changed files with 46 additions and 179 deletions

View file

@ -5,8 +5,6 @@ on:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
release:
types: [ published ]
env:
UBUNTU_VERSION: "24.04"
@ -123,35 +121,10 @@ jobs:
path: bootc-${BOOTC_VERSION}/../*.deb
retention-days: 30
create-release:
name: Create Release
create-artifacts:
name: Create Combined Artifacts
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

View file

@ -1,27 +0,0 @@
# 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

View file

@ -23,131 +23,52 @@ jobs:
name: release-assets
path: /tmp/artifacts
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Generate download links
- name: Generate download section
run: |
python3 << 'EOF'
import os
import re
from datetime import datetime
echo "## 📦 Latest Packages" > /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo "> **Note**: These packages are automatically built by CI/CD." >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
# 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)
if [ -d "/tmp/artifacts" ] && [ "$(ls -A /tmp/artifacts)" ]; then
echo "### Download Links" >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo "| Package | Download |" >> /tmp/download_section.md
echo "|---------|----------|" >> /tmp/download_section.md
# Generate download links
base_url = f"https://github.com/{os.environ['GITHUB_REPOSITORY']}/actions/runs/{os.environ['GITHUB_RUN_ID']}/artifacts"
for file in /tmp/artifacts/*.deb; do
if [ -f "$file" ]; then
filename=$(basename "$file")
if [[ "$filename" == *"libostree"* ]]; then
package_name="libostree Backport"
elif [[ "$filename" == *"bootc"* ]]; then
package_name="bootc"
else
package_name="$filename"
fi
echo "| $package_name | $filename |" >> /tmp/download_section.md
fi
done
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
echo "" >> /tmp/download_section.md
echo "### Installation Instructions" >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo '```bash' >> /tmp/download_section.md
echo "# Download and install libostree backport first" >> /tmp/download_section.md
echo "sudo dpkg -i <libostree-package-name>.deb" >> /tmp/download_section.md
echo "sudo apt --fix-broken install -y" >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo "# Then install bootc" >> /tmp/download_section.md
echo "sudo dpkg -i <bootc-package-name>.deb" >> /tmp/download_section.md
echo "sudo apt --fix-broken install -y" >> /tmp/download_section.md
echo '```' >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo "*Last updated: $(date -u '+%Y-%m-%d %H:%M UTC')*" >> /tmp/download_section.md
else
echo "No packages found in artifacts." >> /tmp/download_section.md
echo "" >> /tmp/download_section.md
echo "Check the Actions tab for build status." >> /tmp/download_section.md
fi
- name: Update README
run: |