Skip to content

Commit 1e3b962

Browse files
authored
update aur repo to 1.5.2 (#682)
1 parent 71569d7 commit 1e3b962

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

.github/workflows/release.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -350,48 +350,48 @@ jobs:
350350
run: |
351351
pacman -Syu --noconfirm
352352
pacman -S --noconfirm git openssh base-devel
353-
- name: Create non-root user
354-
run: |
355-
useradd -m -G wheel -s /bin/bash builduser
356-
echo 'builduser ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
357-
- name: Setup SSH
358-
uses: webfactory/ssh-agent@v0.9.0
359-
with:
360-
ssh-private-key: ${{ secrets.AUR_SSH_KEY }}
361-
- name: Checkout AUR repository
353+
- name: Setup SSH for AUR
362354
run: |
363355
mkdir -p ~/.ssh
364-
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts
365-
chmod 644 ~/.ssh/known_hosts
366-
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new"
367-
rm -rf aur-repo
368-
git clone ssh://aur@aur.archlinux.org/defguard-client.git aur-repo
369-
chown -R builduser:builduser aur-repo
370-
- name: Update PKGBUILD version
356+
echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/id_rsa
357+
chmod 600 ~/.ssh/id_rsa
358+
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
359+
chmod 600 ~/.ssh/known_hosts
360+
# Create SSH config file
361+
cat > ~/.ssh/config << EOF
362+
Host aur.archlinux.org
363+
IdentityFile ~/.ssh/id_rsa
364+
User aur
365+
StrictHostKeyChecking accept-new
366+
EOF
367+
chmod 600 ~/.ssh/config
368+
- name: Update AUR Package
371369
run: |
370+
371+
git config --global user.name "Defguard Build System"
372+
git config --global user.email "community@defguard.net"
373+
git config --global --add safe.directory '*'
374+
375+
rm -rf aur-repo || true
376+
GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=accept-new" \
377+
git clone "ssh://aur@aur.archlinux.org/defguard-client.git" aur-repo
372378
cd aur-repo
379+
git config --global --add safe.directory "$(pwd)"
373380
VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1)
374-
375381
echo "Updating to version: $VERSION"
376382
sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
377383
378384
AMD64_SHA="${{ needs.build-linux.outputs.deb_sha256_amd64 }}"
379-
380385
echo "AMD64 DEB SHA256: $AMD64_SHA"
381386
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('$AMD64_SHA')/" PKGBUILD
382-
- name: Update .SRCINFO
383-
run: |
384-
cd aur-repo
385-
sudo -u builduser makepkg --printsrcinfo > .SRCINFO
386-
- name: Commit and push changes
387-
run: |
388-
cd aur-repo
387+
388+
useradd -m builduser
389389
chown -R builduser:builduser .
390-
sudo -u builduser git config user.name "Defguard Build System"
391-
sudo -u builduser git config user.email "community@defguard.net"
392-
sudo -u builduser git add PKGBUILD .SRCINFO
393-
sudo -u builduser git commit -m "Updated to $VERSION"
394-
sudo -u builduser git push
390+
391+
su builduser -c "makepkg --printsrcinfo" > .SRCINFO
392+
git add PKGBUILD .SRCINFO
393+
git commit -m "Updated to $VERSION"
394+
GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=accept-new" git push
395395
cat PKGBUILD
396396
cat .SRCINFO
397397

0 commit comments

Comments
 (0)