qubes-builder-alpine/.forgejo/bin/deploy.sh

30 lines
694 B
Bash
Raw Permalink Normal View History

2024-08-22 20:13:07 +00:00
#!/bin/bash
2024-08-22 17:31:32 +00:00
# shellcheck disable=SC3040
set -eu -o pipefail
readonly REPOS="backports user"
readonly QUBES_REL=$( echo $GITHUB_REF_NAME | awk -F '-' '{print $2}')
readonly TARGET_REPO=$CI_RPM_REPO
readonly group="qubes/$QUBES_REL"
readonly rpm=$(find . -name 'qubes-template-*.rpm')
2024-08-22 20:13:07 +00:00
echo "Signing $rpm"
gpg --import <<< $FORGE_REPO_PRIVKEY
gpg --export -a > forge-repo.pub
rpm --import forge-repo.pub
cat << EOF > $HOME/.rpmmacros
%_signature gpg
%_gpg_path $HOME/.gnupg
%_gpg_name RPM Registry
%_gpgbin /usr/bin/gpg
EOF
rpm --addsign $rpm
2024-08-22 17:31:32 +00:00
echo "Sending $rpm to $TARGET_REPO/$group/upload"
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $rpm $TARGET_REPO/$group/upload