name: Update Arch Repository on: push: paths: - 'x86_64/*.pkg.tar.zst' workflow_dispatch: jobs: update-db: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup tools run: sudo apt-get update && sudo apt-get install -y libarchive-tools - name: Update Repository Database run: | cd x86_64 # Download a repo-add script that works on Ubuntu curl -L https://raw.githubusercontent.com/anthraxx/pacman-repo-add/master/repo-add -o repo-add chmod +x repo-add # Use the real tool to build the database pacman expects ./repo-add hyprarch-repo.db.tar.gz *.pkg.tar.zst # Clean up the tool rm repo-add # Fix symlinks for GitHub Pages rm -f hyprarch-repo.db hyprarch-repo.files cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.files.tar.gz hyprarch-repo.files - name: Generate Indices run: | # 1. Create the BASIC PYTHON-STYLE index for the x86_64 folder cd x86_64 echo "Index of /x86_64/" > index.html echo "

Index of /x86_64/


" >> index.html
          echo "../" >> index.html
          for file in *; do
            if [ "$file" != "index.html" ]; then
              size=$(du -sh "$file" | cut -f1)
              date=$(date -r "$file" '+%d-%b-%Y %H:%M')
              printf "%s%-$(($(printf '%s' "$file" | wc -c) > 50 ? 1 : 50 - $(printf '%s' "$file" | wc -c)))s %s %8s\n" "$file" "$file" "" "$date" "$size" >> index.html
            fi
          done
          echo "

" >> index.html # 2. Create YOUR SPECIFIC LANDING PAGE for the Root folder cd .. cat <<'EOF' > index.html HyprArch Repository

🚀 HyprArch Custom Repository

To use this repository, add the following to your /etc/pacman.conf:

[hyprarch-repo]
SigLevel = Optional TrustAll
Server = https://hyprarch-repo.stuple.net/$arch

📦 Available Packages


Automated by GitHub Actions

EOF - name: Commit and Push changes run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . if ! git diff-index --quiet HEAD; then git commit -m "Fixed DB format and index indentation" git push else echo "Nothing to change." fi