Skip to content

Commit a448e80

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

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,77 @@ 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+
tar czvf test-images.tar.gz test*.ext4*
324+
sed -i "s|pkgver=.*|pkgver=${version#v}|" PKGBUILD
325+
updpkgsums PKGBUILD
326+
makepkg --printsrcinfo > .SRCINFO
327+
git add -f PKGBUILD .SRCINFO
328+
git config --local user.email "nathaniel.vandiepen@gmail.com"
329+
git config --local user.name "Nathaniel van Diepen"
330+
git commit -m "Update to ${version#v}"
331+
git show
332+
'
333+
env:
334+
version: ${{ github.ref_name }}
335+
336+
- name: Test PKGBUILD
337+
run: |
338+
sudo -u notroot makepkg \
339+
--noconfirm \
340+
--syncdeps \
341+
--install
342+
343+
- name: Push PKGBUILD
344+
run: |
345+
su notroot -c '
346+
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/aur" \
347+
git push
348+
'

0 commit comments

Comments
 (0)