Skip to content

Commit c95c9ad

Browse files
Adding pkguser creation used to run makepkg for Arch Linux packaging.
After testing GH Actions in my own fork, I confirmed that it is indeed run as a root user.
1 parent fa1fcca commit c95c9ad

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/package.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ jobs:
155155
with:
156156
name: sourcegit.${{ matrix.runtime }}
157157
path: build
158+
- name: Create package user
159+
run: |
160+
apt-get install -y sudo
161+
useradd -m pkguser
162+
echo "pkguser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
163+
chown -R pkguser:pkguser build
158164
- name: Package
159165
env:
160166
VERSION: ${{ inputs.version }}

build/scripts/package.linux.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ build_arch_package() {
116116
ln -rsf resources/aur/opt/sourcegit/sourcegit resources/aur/usr/bin
117117
cp -r resources/_common/applications resources/aur/usr/share
118118
cp -r resources/_common/icons resources/aur/usr/share
119+
chown -R pkguser:pkguser ./
120+
119121

120122
cd "resources/aur/" || exit 1
121123

122-
makepkg --nodeps
124+
if [ "$(id -u)" -eq 0 ]; then
125+
sudo -E -u pkguser makepkg --nodeps
126+
else
127+
makepkg --nodeps
128+
fi
123129

124130
cd ../../ # return to previous path
125131

0 commit comments

Comments
 (0)