adding instructions on how to add gpg key

This commit is contained in:
Mitsuba100
2026-03-23 16:20:58 +01:00
parent 430cd419e0
commit 31ddfeffff

View File

@@ -25,7 +25,6 @@ jobs:
echo "ERROR: GPG_PRIVATE_KEY secret is empty!"
exit 1
fi
# Save key to a temp file to avoid "invalid option" command-line errors
echo "${{ secrets.GPG_PRIVATE_KEY }}" > private_key.gpg
gpg --batch --import private_key.gpg
rm private_key.gpg
@@ -34,15 +33,15 @@ jobs:
run: |
cd x86_64
rm -f hyprarch-repo.db* hyprarch-repo.files*
mkdir -p db_temp
export GPG_TTY=$(tty)
# Define passphrase variable from secrets
PASS="${{ secrets.GPG_PASSPHRASE }}"
# Export public key to the folder so it is accessible via URL
gpg --export --armor 236328A7F2C2001E > pubkey.gpg
for pkg in *.pkg.tar.zst; do
# 1. Sign the package
echo "$PASS" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor "$pkg"
# 1. Sign the package file
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor "$pkg"
# 2. Extract Metadata
pkgname=$(bsdtar -xOf "$pkg" .PKGINFO | grep "^pkgname =" | cut -d' ' -f3)
@@ -71,7 +70,7 @@ jobs:
echo "$(bsdtar -xOf "$pkg" .PKGINFO | grep "^size =" | cut -d' ' -f3)"
echo ""
echo "%PGPSIG%"
echo "$PASS" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --stdout --no-armor "$pkg" | base64 | tr -d '\n'
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --stdout --no-armor "$pkg" | base64 | tr -d '\n'
echo ""
} > "db_temp/$pkgname-$pkgver/desc"
done
@@ -80,7 +79,7 @@ jobs:
cd db_temp
tar -c * | gzip -9 > ../hyprarch-repo.db.tar.gz
cd ..
echo "$PASS" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor hyprarch-repo.db.tar.gz
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --local-user 236328A7F2C2001E --passphrase-fd 0 --detach-sign --no-armor hyprarch-repo.db.tar.gz
# 4. Finalize
cp hyprarch-repo.db.tar.gz hyprarch-repo.db
@@ -114,25 +113,36 @@ jobs:
body { font-family: sans-serif; margin: 40px; line-height: 1.6; background: #2e3440; color: #eceff4; }
a { color: #88c0d0; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 800px; margin: auto; background: #3b4252; padding: 20px; border-radius: 8px; }
h1 { border-bottom: 2px solid #4c566a; padding-bottom: 10px; }
pre { background: #2e3440; padding: 15px; border-radius: 5px; color: #ebcb8b; }
.container { max-width: 900px; margin: auto; background: #3b4252; padding: 20px; border-radius: 8px; }
h1 { border-bottom: 2px solid #4c566a; padding-bottom: 10px; color: #81a1c1; }
h2 { color: #a3be8c; margin-top: 30px; }
pre { background: #2e3440; padding: 15px; border-radius: 5px; color: #ebcb8b; overflow-x: auto; border: 1px solid #4c566a; }
code { color: #d08770; }
.step { background: #434c5e; padding: 10px 15px; border-left: 4px solid #81a1c1; margin: 10px 0; }
</style>
</head>
<body>
<div class="container">
<h1>🚀 HyprArch Custom Repository</h1>
<p>To use this repository, add the following to your <code>/etc/pacman.conf</code>:</p>
<h2>1. Add the GPG Key</h2>
<p>Run this command to trust the repository maintainer (Stuart Drew):</p>
<pre>curl -s https://hyprarch-repo.stuple.net/x86_64/pubkey.gpg | sudo pacman-key -a - && sudo pacman-key --lsign-key 236328A7F2C2001E</pre>
<h2>2. Configure Pacman</h2>
<p>Add the following to the bottom of <code>/etc/pacman.conf</code>:</p>
<pre>[hyprarch-repo]
SigLevel = Required DatabaseOptional
Server = https://hyprarch-repo.stuple.net/$arch</pre>
<h2>📦 Available Packages</h2>
<ul>
<li><a href="./x86_64/">Browse x86_64 Packages</a></li>
</ul>
<hr>
<p><small>Automated by GitHub Actions</small></p>
<h2>3. Sync and Install</h2>
<div class="step">
<code>sudo pacman -Sy HyprArch-hyprland-git</code>
</div>
<hr style="margin-top:40px; border: 0; border-top: 1px solid #4c566a;">
<p><a href="./x86_64/">📁 Browse File Index</a></p>
<p><small>Automated by GitHub Actions • Last updated: '$(date)'</small></p>
</div>
</body>
</html>' > index.html
@@ -143,7 +153,7 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "Fix GPG import method and finalize signing"
git commit -m "Add GPG trust command to landing page"
git push
else
echo "Nothing to change."