From bb0306278d653ce4825f026d376762bbb7799f2b Mon Sep 17 00:00:00 2001 From: Mitsuba100 Date: Tue, 14 Apr 2026 21:29:00 +0200 Subject: [PATCH] Update .github/workflows/update-repo.yml --- .github/workflows/update-repo.yml | 66 +++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-repo.yml b/.github/workflows/update-repo.yml index 54a1ee8..b884721 100644 --- a/.github/workflows/update-repo.yml +++ b/.github/workflows/update-repo.yml @@ -1,4 +1,4 @@ -name: Update Arch Repository +name: Update Arch Repository (Host stui) on: push: @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Import GPG Key run: | @@ -21,16 +23,18 @@ jobs: - name: Build and Sign Repository run: | cd x86_64 + # Remove old database files rm -f hyprarch-repo.db* hyprarch-repo.files* mkdir -p db_temp + # Export public key for landing page gpg --export --armor 236328A7F2C2001E > pubkey.gpg for pkg in *.pkg.tar.zst; do - # Create BINARY detached signature + # 1. Create BINARY detached signature echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --output "$pkg.sig" "$pkg" - # Extract Metadata + # 2. Extract Metadata safely pkgname=$(bsdtar -xOf "$pkg" .PKGINFO | grep "^pkgname =" | cut -d' ' -f3 | tr -d '\r') pkgver=$(bsdtar -xOf "$pkg" .PKGINFO | grep "^pkgver =" | cut -d' ' -f3 | tr -d '\r') pkgdesc=$(bsdtar -xOf "$pkg" .PKGINFO | grep "^pkgdesc =" | cut -d' ' -f3- | sed "s/['\"]//g" | tr -d '\r') @@ -38,7 +42,6 @@ jobs: instsize=$(bsdtar -xOf "$pkg" .PKGINFO | grep "^size =" | cut -d' ' -f3 | tr -d '\r') mkdir -p "db_temp/$pkgname-$pkgver" - { echo "%NAME%"; echo "$pkgname"; echo "" echo "%VERSION%"; echo "$pkgver"; echo "" @@ -53,36 +56,73 @@ jobs: } > "db_temp/$pkgname-$pkgver/desc" done + # 3. Pack the Database cd db_temp tar --owner=0 --group=0 -c * | gzip -n -9 > ../hyprarch-repo.db.tar.gz cd .. + + # 4. Sign and Finalize Database cp hyprarch-repo.db.tar.gz hyprarch-repo.db cp hyprarch-repo.db.tar.gz hyprarch-repo.files echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --output hyprarch-repo.db.sig hyprarch-repo.db rm -rf db_temp - - name: Generate Landing Page + - name: Generate Subfolder Index + run: | + 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 + + - name: Generate Root Landing Page run: | cat < index.html - HyprArch Repo + HyprArch Repository
-

🚀 HyprArch Pi Repository

+

🚀 HyprArch Custom Repository

+ +

1. Add the GPG Key

+

Run this command to trust the repository maintainer (Mitsuba100):

curl -s https://repo.stuple.net/x86_64/pubkey.gpg | sudo pacman-key -a - && sudo pacman-key --lsign-key 236328A7F2C2001E
+ +

2. Configure Pacman

+

Add the following to the bottom of /etc/pacman.conf:

[hyprarch-repo]
           SigLevel = Required DatabaseOptional
           Server = https://repo.stuple.net/\$arch
-

📂 Browse File Index

+ +

3. Sync

+
+ sudo pacman -Sy +
+ +
+

📁 Browse File Index

+

Automated by GitHub Actions • Last updated: '$(date)'

@@ -90,6 +130,6 @@ jobs: - name: Deploy to Local Web Folder run: | - # Since stui now owns the folder, we don't need sudo here + # Use your correct repo path and ensure stui has write access to it mkdir -p /var/www/hyprarch-repo/x86_64 cp -rf . /var/www/hyprarch-repo/ \ No newline at end of file