Files
mistralrs-package/script/publish-repo.sh
rob thijssen 70ae2108ee
All checks were successful
poll-upstream / check (push) Successful in 1s
fix(ci): import public key for checksig and force dist tag override
Import the GPG public key into rpm's keyring so rpm --checksig can
verify signatures. Also use --undefine dist before --define to ensure
the CLI value overrides the system macro on the build host.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 15:27:40 +03:00

31 lines
905 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
RPM_DIR="${1:?usage: $0 <rpm-directory>}"
: "${FEDORA_VERSION:?}"
REMOTE_DIR="/var/www/rpm/fedora/${FEDORA_VERSION}/x86_64"
# import the public key into rpm's keyring for verification
gpg --export --armor "$(rpm --eval '%{_gpg_name}')" | rpm --import /dev/stdin
# sign each rpm with the imported gpg key
for rpm in "${RPM_DIR}"/*.rpm; do
echo "signing ${rpm}..."
rpm --addsign "${rpm}"
rpm --checksig "${rpm}"
done
install --directory --mode 700 ~/.ssh
echo "${RSYNC_SSH_KEY}" | install --mode 600 /dev/stdin ~/.ssh/id_ed25519
ssh-keyscan -H oolon.kosherinata.internal > ~/.ssh/known_hosts 2>/dev/null
rsync \
--archive \
--verbose \
--chmod D755,F644 \
"${RPM_DIR}/"*.rpm \
"${RSYNC_TARGET}:${REMOTE_DIR}/"
ssh "${RSYNC_TARGET}" "cd ${REMOTE_DIR} && createrepo_c --update ."
echo "Published $(ls ${RPM_DIR}/*.rpm | wc -l) RPMs"