Skip to content

Commit ef46c8b

Browse files
committed
Update AUR automatically
1 parent 47ad9bf commit ef46c8b

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,76 @@ jobs:
272272
GH_TOKEN: ${{ github.token }}
273273
TAG: ${{ github.event.release.tag_name }}
274274
working-directory: ${{ steps.download.outputs.download-path }}
275+
276+
aur:
277+
name: Update the AUR
278+
if: github.repository == 'Eeems/python-ext4' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
279+
needs: publish
280+
runs-on: ubuntu-latest
281+
container:
282+
image: eeems/archlinux:nuitka
283+
options: --user=root:root
284+
steps:
285+
- name: Setup
286+
run: |
287+
chmod a+rwx .
288+
chown notroot ~ .
289+
su notroot -c '
290+
yay -Syu --noconfirm
291+
yay -S --noconfirm \
292+
python-build \
293+
python-installer \
294+
python-setuptools \
295+
rhash
296+
mkdir -p "$HOME"/.ssh/
297+
pushd "$HOME"/.ssh/
298+
echo "${AUR_SSH:?ssh key missing}" > aur
299+
chmod 0600 aur
300+
chmod 0700 .
301+
file aur
302+
popd
303+
'
304+
env:
305+
AUR_SSH: ${{ secrets.AUR_SSH }}
306+
307+
- name: Checkout the AUR repository
308+
run: |
309+
su notroot -c '
310+
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/aur" \
311+
git clone ssh://aur@aur.archlinux.org/python-ext4.git .
312+
'
313+
314+
- name: Download test.ext4
315+
uses: actions/download-artifact@v8
316+
with:
317+
name: test.ext4
318+
path: .
319+
320+
- name: Update PKGBUILD
321+
run: |
322+
su notroot -c '
323+
version="${{ github.ref_name }}"
324+
tar czvf test-images.tar.gz test*.ext4*
325+
sed -i "s|pkgver=.*|pkgver=${version#v}|" PKGBUILD
326+
updpkgsums PKGBUILD
327+
makepkg --printsrcinfo > .SRCINFO
328+
git add -f PKGBUILD .SRCINFO
329+
git config --local user.email "nathaniel.vandiepen@gmail.com"
330+
git config --local user.name "Nathaniel van Diepen"
331+
git commit -m "Update to ${version#v}"
332+
git show
333+
'
334+
335+
- name: Test PKGBUILD
336+
run: |
337+
sudo -u notroot makepkg \
338+
--noconfirm \
339+
--syncdeps \
340+
--install
341+
342+
- name: Push PKGBUILD
343+
run: |
344+
su notroot -c '
345+
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/aur" \
346+
git push
347+
'

0 commit comments

Comments
 (0)