diff --git a/.forgejo/workflows/build-packages.yml b/.forgejo/workflows/build-packages.yml index 9735b8a..025036e 100644 --- a/.forgejo/workflows/build-packages.yml +++ b/.forgejo/workflows/build-packages.yml @@ -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 diff --git a/.forgejo/workflows/config.yml b/.forgejo/workflows/config.yml deleted file mode 100644 index b59baac..0000000 --- a/.forgejo/workflows/config.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/.forgejo/workflows/update-readme.yml b/.forgejo/workflows/update-readme.yml index d7d1c03..6b481ef 100644 --- a/.forgejo/workflows/update-readme.yml +++ b/.forgejo/workflows/update-readme.yml @@ -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) - - # 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 ") - print("sudo dpkg -i .deb") - print("sudo apt --fix-broken install -y") - print() - print("# Then install bootc") - print("wget ") - print("sudo dpkg -i .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 ") - print("sudo dpkg -i .deb") - print("sudo apt --fix-broken install -y") - print() - print("# Then install bootc") - print("wget ") - print("sudo dpkg -i .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 + 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 + + 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 + + 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 .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 .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: |