name: Update Arch Repository on: push: paths: - 'x86_64/*.pkg.tar.zst' workflow_dispatch: jobs: build-and-deploy: runs-on: local steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Import GPG Key run: | echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import --yes - name: Build and Sign Repository run: | cd x86_64 # Remove ALL old metadata and symlinks to start fresh rm -f hyprarch-repo.db* hyprarch-repo.files* # 1. Export public key gpg --export --armor 236328A7F2C2001E > pubkey.gpg # 2. Sign packages (Force BINARY by removing --armor) for pkg in *.pkg.tar.zst; do echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign "$pkg" done # 3. Build DB using Python helper (Ensure you updated the script on the Pi as well) python3 ~/build_db.py # 4. Finalize Files (NO SYMLINKS) # We manually copy instead of linking so the web server sees real files cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.db.tar.gz hyprarch-repo.files # 5. Sign the DB (Binary) echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign hyprarch-repo.db # 6. Ensure .sig files match the main files exactly cp hyprarch-repo.db.sig hyprarch-repo.db.tar.gz.sig - name: Generate Subfolder Index run: | cd x86_64 echo "
" >> 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 "curl -s https://repo.stuple.net/x86_64/pubkey.gpg | sudo pacman-key -a - && sudo pacman-key --lsign-key 236328A7F2C2001E
[hyprarch-repo]
SigLevel = Required DatabaseOptional
Server = https://repo.stuple.net/\$arch
sudo pacman -SyyLast updated: '$(date)'