Skip to content

Commit 8a3ed05

Browse files
authored
Fix release SRPM GoReleaser config (#24)
1 parent abf774e commit 8a3ed05

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.goreleaser.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,19 @@ archives:
116116
- src: packaging/NetworkManager/conf.d/90-netbird-unmanaged.conf
117117
dst: packaging/NetworkManager/conf.d/90-netbird-unmanaged.conf
118118

119+
source:
120+
enabled: true
121+
name_template: 'network-manager-netbird-{{ .Version }}'
122+
prefix_template: 'network-manager-netbird-{{ .Version }}/'
123+
119124
srpm:
120125
enabled: true
121126
package_name: network-manager-netbird
122127
spec_file: packaging/rpm/network-manager-netbird.spec.tmpl
123128
import_path: github.com/netbirdio/network-manager-plugin
124-
summary: NetworkManager VPN plugin for NetBird
129+
nfpmrpm:
130+
summary: NetworkManager VPN plugin for NetBird
131+
group: Applications/Internet
125132
license: BSD-3-Clause
126133
license_file_name: LICENSE
127134
url: https://github.com/netbirdio/network-manager-vpn-plugin
@@ -133,7 +140,6 @@ srpm:
133140
- README.md
134141
- docs/reference.md
135142
- docs/architecture.md
136-
group: Applications/Internet
137143

138144
nfpms:
139145
- id: linux-packages

scripts/build-fedora-selinux-policy.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ case "$runtime" in
3030
esac
3131

3232
"$runtime" run --rm \
33+
-e HOST_UID="$(id -u)" \
34+
-e HOST_GID="$(id -g)" \
3335
-v "$volume_arg" \
3436
-w /src \
3537
"$fedora_image" \
@@ -42,6 +44,19 @@ esac
4244
trap '\''rm -rf "$store"'\'' EXIT
4345
cp -a /var/lib/selinux/targeted "$store/"
4446
semodule -s targeted -S "$store" -N -i packaging/selinux/nm_netbird.pp
47+
48+
if [ "${HOST_UID:-0}" != 0 ]; then
49+
for path in \
50+
packaging/selinux/nm_netbird.pp \
51+
packaging/selinux/nm_netbird.mod \
52+
packaging/selinux/nm_netbird.mod.fc \
53+
packaging/selinux/nm_netbird.if \
54+
packaging/selinux/nm_netbird.fc.tmp \
55+
packaging/selinux/tmp; do
56+
[ -e "$path" ] || continue
57+
chown -R "$HOST_UID:${HOST_GID:-$HOST_UID}" "$path" 2>/dev/null || true
58+
done
59+
fi
4560
'
4661

4762
# Docker commonly writes generated files as root. Restore ownership so later CI
@@ -58,8 +73,8 @@ if [ "$(id -u)" -ne 0 ]; then
5873
if chown -R "$(id -u):$(id -g)" "$path" 2>/dev/null; then
5974
continue
6075
fi
61-
if command -v sudo >/dev/null 2>&1; then
62-
sudo chown -R "$(id -u):$(id -g)" "$path" || true
76+
if command -v sudo >/dev/null 2>&1 && sudo -n true 2>/dev/null; then
77+
sudo -n chown -R "$(id -u):$(id -g)" "$path" || true
6378
fi
6479
done
6580
fi

0 commit comments

Comments
 (0)