chore(release): enhance AUR SSH setup for key handling
* Improve SSH key setup by auto-detecting key format * Add diagnostics for key validation and size
This commit is contained in:
@@ -105,14 +105,27 @@ jobs:
|
|||||||
VERSION="${{ github.event.inputs.tag || github.ref_name }}"
|
VERSION="${{ github.event.inputs.tag || github.ref_name }}"
|
||||||
PKGVER="${VERSION#v}"
|
PKGVER="${VERSION#v}"
|
||||||
|
|
||||||
# Setup SSH for AUR (key is stored base64-encoded to avoid newline mangling in secrets)
|
# Setup SSH for AUR
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "$AUR_SSH_KEY" | base64 -d > ~/.ssh/aur
|
chmod 700 ~/.ssh
|
||||||
|
|
||||||
|
# Auto-detect: raw PEM key or base64-encoded key
|
||||||
|
if printf '%s' "$AUR_SSH_KEY" | grep -q "BEGIN"; then
|
||||||
|
printf '%b' "$AUR_SSH_KEY" > ~/.ssh/aur
|
||||||
|
else
|
||||||
|
printf '%s' "$AUR_SSH_KEY" | tr -d '[:space:]' | base64 -d > ~/.ssh/aur
|
||||||
|
fi
|
||||||
chmod 600 ~/.ssh/aur
|
chmod 600 ~/.ssh/aur
|
||||||
|
|
||||||
|
# Diagnostics (no key content exposed)
|
||||||
|
echo "Key file size: $(wc -c < ~/.ssh/aur) bytes"
|
||||||
|
echo "Key file first line: $(head -1 ~/.ssh/aur)"
|
||||||
|
echo "Key file last line: $(tail -1 ~/.ssh/aur)"
|
||||||
|
ssh-keygen -l -f ~/.ssh/aur && echo "Key is valid" || echo "Key is INVALID"
|
||||||
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
# Clone AUR repo
|
# Clone AUR repo
|
||||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/aur" git clone ssh://aur@aur.archlinux.org/unitdore.git aur-repo
|
GIT_SSH_COMMAND="ssh -vvv -i ~/.ssh/aur" git clone ssh://aur@aur.archlinux.org/unitdore.git aur-repo
|
||||||
|
|
||||||
# Compute SHA256 of the release tarball (same URL the PKGBUILD will download)
|
# Compute SHA256 of the release tarball (same URL the PKGBUILD will download)
|
||||||
SHA=$(curl -fsSL "https://git.warky.dev/wdevs/unitdore/archive/v${PKGVER}.zip" | sha256sum | cut -d' ' -f1)
|
SHA=$(curl -fsSL "https://git.warky.dev/wdevs/unitdore/archive/v${PKGVER}.zip" | sha256sum | cut -d' ' -f1)
|
||||||
@@ -141,7 +154,7 @@ jobs:
|
|||||||
git config user.name "Hein"
|
git config user.name "Hein"
|
||||||
git add PKGBUILD .SRCINFO
|
git add PKGBUILD .SRCINFO
|
||||||
git commit -m "Update to v${PKGVER}"
|
git commit -m "Update to v${PKGVER}"
|
||||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/aur" git push origin HEAD:master
|
GIT_SSH_COMMAND="ssh -vvv -i ~/.ssh/aur" git push origin HEAD:master
|
||||||
|
|
||||||
pkg-deb:
|
pkg-deb:
|
||||||
needs: release
|
needs: release
|
||||||
|
|||||||
Reference in New Issue
Block a user