mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-26 09:55:48 +08:00
Fix rpm signing: hand the built packages back to the runner user
The rpm build runs in a container as root, so the packages arrived in the
workspace owned by root. Renaming them still worked, since that only needs
write permission on the directory, but rpm --addsign rewrites the file in
place and failed:
error: 3proxy-0.9.9.0.el9.x86_64.rpm: open failed: Permission denied
Restore the invoking user's ownership before leaving the container, falling
back to a mode change where the container cannot chown, as under a rootless
container runtime.
This commit is contained in:
parent
33b2a31180
commit
7a80a6ceb8
5
.github/workflows/build-rpm-arm64.yml
vendored
5
.github/workflows/build-rpm-arm64.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
|||||||
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
||||||
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
||||||
-v "$PWD/rpmout:/out" \
|
-v "$PWD/rpmout:/out" \
|
||||||
-e RELEASE="$RELEASE" \
|
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
|
||||||
"almalinux:$EL" bash -c '
|
"almalinux:$EL" bash -c '
|
||||||
set -e
|
set -e
|
||||||
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
||||||
@ -59,7 +59,8 @@ jobs:
|
|||||||
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
cd ~/rpmbuild/SPECS
|
cd ~/rpmbuild/SPECS
|
||||||
rpmbuild -ba 3proxy-$RELEASE.spec
|
rpmbuild -ba 3proxy-$RELEASE.spec
|
||||||
cp ~/rpmbuild/RPMS/*/*.rpm /out/'
|
cp ~/rpmbuild/RPMS/*/*.rpm /out/
|
||||||
|
chown "$HOSTUID:$HOSTGID" /out/*.rpm || chmod 0666 /out/*.rpm'
|
||||||
done
|
done
|
||||||
for f in rpmout/*.rpm; do
|
for f in rpmout/*.rpm; do
|
||||||
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
||||||
|
|||||||
5
.github/workflows/build-rpm-x86-64.yml
vendored
5
.github/workflows/build-rpm-x86-64.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
|||||||
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
||||||
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
||||||
-v "$PWD/rpmout:/out" \
|
-v "$PWD/rpmout:/out" \
|
||||||
-e RELEASE="$RELEASE" \
|
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
|
||||||
"almalinux:$EL" bash -c '
|
"almalinux:$EL" bash -c '
|
||||||
set -e
|
set -e
|
||||||
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
||||||
@ -59,7 +59,8 @@ jobs:
|
|||||||
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
cd ~/rpmbuild/SPECS
|
cd ~/rpmbuild/SPECS
|
||||||
rpmbuild -ba 3proxy-$RELEASE.spec
|
rpmbuild -ba 3proxy-$RELEASE.spec
|
||||||
cp ~/rpmbuild/RPMS/*/*.rpm /out/'
|
cp ~/rpmbuild/RPMS/*/*.rpm /out/
|
||||||
|
chown "$HOSTUID:$HOSTGID" /out/*.rpm || chmod 0666 /out/*.rpm'
|
||||||
done
|
done
|
||||||
for f in rpmout/*.rpm; do
|
for f in rpmout/*.rpm; do
|
||||||
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user