- Remove GitHub Actions specific syntax (actions/checkout@v4, actions/upload-artifact@v3) - Replace with Forgejo-compatible alternatives (manual git clone, summary creation) - Remove actions-rs/toolchain@v1 dependency - Remove actions/cache@v3 dependency - All workflows now use pure Forgejo-compatible syntax - Maintain apt-cacher-ng support and debian:latest containers
169 lines
No EOL
6.2 KiB
YAML
169 lines
No EOL
6.2 KiB
YAML
name: Update README with Download Links
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Build apt-ostree Package"]
|
|
types: [completed]
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
update-readme:
|
|
name: Update README with Download Links
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: debian:latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
steps:
|
|
- name: Setup environment
|
|
run: |
|
|
# Update package lists
|
|
apt update -y
|
|
|
|
# Install essential tools
|
|
apt install -y git curl wget
|
|
|
|
# Check if apt-cacher-ng is available and configure sources accordingly
|
|
echo "Checking for apt-cacher-ng availability..."
|
|
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
|
|
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
|
|
|
|
# Configure apt-cacher-ng proxy sources
|
|
cat > /etc/apt/sources.list.d/apt-cacher-ng.list << 'EOF'
|
|
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
|
|
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
|
|
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
|
|
EOF
|
|
|
|
# Update package lists with proxy sources
|
|
apt update -y
|
|
else
|
|
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
|
|
|
|
# Use standard Debian sources
|
|
cat > /etc/apt/sources.list.d/standard.list << 'EOF'
|
|
deb http://deb.debian.org/debian stable main contrib non-free
|
|
deb-src http://deb.debian.org/debian stable main contrib non-free
|
|
EOF
|
|
|
|
# Update package lists
|
|
apt update -y
|
|
fi
|
|
|
|
- name: Checkout repository manually
|
|
run: |
|
|
# Clone the repository manually instead of using actions/checkout
|
|
git clone https://git.raines.xyz/robojerk/apt-ostree.git /tmp/apt-ostree
|
|
cp -r /tmp/apt-ostree/* .
|
|
cp -r /tmp/apt-ostree/.* . 2>/dev/null || true
|
|
|
|
- name: Update README with download links
|
|
run: |
|
|
# Get current date and workflow run ID
|
|
BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S UTC')
|
|
WORKFLOW_RUN_ID=${{ github.event.workflow_run.id }}
|
|
|
|
echo "Updating README with workflow run ID: $WORKFLOW_RUN_ID"
|
|
|
|
# Create the download section content
|
|
cat > download-section.md << EOF
|
|
|
|
## 📦 Download Latest Build
|
|
|
|
**Last Built**: $BUILD_DATE
|
|
**Version**: 0.1.0-1
|
|
**Target**: Debian Stable
|
|
**Build ID**: [$WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID)
|
|
|
|
### Download Links
|
|
|
|
- **apt-ostree_0.1.0-1_amd64.deb** - [Download from Build $WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID)
|
|
- **apt-ostree-dbgsym_0.1.0-1_amd64.ddeb** - [Download from Build $WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID)
|
|
|
|
### Quick Installation
|
|
|
|
\`\`\`bash
|
|
# Download and install the package
|
|
# Visit: https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID
|
|
# Download the .deb files and run:
|
|
sudo dpkg -i apt-ostree_0.1.0-1_amd64.deb
|
|
sudo apt-get install -f # Install any missing dependencies
|
|
\`\`\`
|
|
|
|
### Verification
|
|
|
|
\`\`\`bash
|
|
# Check if apt-ostree is installed
|
|
apt-ostree --version
|
|
# Should output: apt-ostree 0.1.0
|
|
\`\`\`
|
|
|
|
### Usage Example
|
|
|
|
\`\`\`bash
|
|
# Check status
|
|
apt-ostree status
|
|
|
|
# List packages
|
|
apt-ostree list
|
|
|
|
# Search packages
|
|
apt-ostree search <package-name>
|
|
|
|
# Build OCI image
|
|
apt-ostree compose build-chunked-oci <treefile.yaml>
|
|
\`\`\`
|
|
|
|
---
|
|
|
|
EOF
|
|
|
|
# Replace the existing download section in README.md
|
|
# First, remove the old download section
|
|
sed -i '/## 📦 Download Latest Build/,/^---$/d' README.md
|
|
|
|
# Then insert the new download section after the first section
|
|
awk '/^## 🚀 Quick Start/{print; 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 for workflow run $WORKFLOW_RUN_ID"
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
# Configure git
|
|
git config --global user.email "action@github.com"
|
|
git config --global user.name "GitHub Action"
|
|
|
|
# Add and commit changes
|
|
git add README.md
|
|
git commit -m "Update README with download links for build ${{ github.event.workflow_run.id }}"
|
|
|
|
# Push changes
|
|
git push origin main
|
|
|
|
- name: Create update summary
|
|
run: |
|
|
echo "Creating update summary..."
|
|
|
|
# Create a summary markdown file
|
|
cat > UPDATE_SUMMARY.md << 'EOF'
|
|
# README Update Summary
|
|
|
|
## Update Information
|
|
- **Update Date**: $(date '+%Y-%m-%d %H:%M:%S UTC')
|
|
- **Triggered by**: Build workflow ${{ github.event.workflow_run.id }}
|
|
- **Status**: ✅ SUCCESS
|
|
|
|
## Changes Made
|
|
- Updated download section with latest build links
|
|
- Updated target platform from Ubuntu Noble to Debian Stable
|
|
- Updated build ID reference
|
|
- Maintained all existing functionality
|
|
|
|
## Next Steps
|
|
- README has been automatically updated
|
|
- Changes have been committed and pushed to main branch
|
|
- Users can now access the latest build information
|
|
EOF
|
|
|
|
echo "Update summary created: UPDATE_SUMMARY.md"
|
|
echo "README update completed successfully! 🎉" |