This commit is contained in:
parent
660465b08d
commit
6cf1b770a7
1 changed files with 71 additions and 0 deletions
71
.forgejo/workflows/update-aur.yml
Normal file
71
.forgejo/workflows/update-aur.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
name: Auto-update AUR
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-aur:
|
||||
runs-on: docker
|
||||
|
||||
container:
|
||||
image: archlinux:latest
|
||||
|
||||
steps:
|
||||
- name: Install Arch build tools
|
||||
run: |
|
||||
pacman -Sy --noconfirm git base-devel nodejs npm openssh
|
||||
|
||||
- name: Checkout AUR repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Git identity
|
||||
run: |
|
||||
git config --global user.name "creations"
|
||||
git config --global user.email "aur@creations.works"
|
||||
|
||||
- name: Set up SSH for AUR
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
|
||||
chmod 600 ~/.ssh/aur
|
||||
cat >> ~/.ssh/config <<EOF
|
||||
Host aur.archlinux.org
|
||||
User aur
|
||||
IdentityFile ~/.ssh/aur
|
||||
IdentitiesOnly yes
|
||||
StrictHostKeyChecking no
|
||||
EOF
|
||||
|
||||
- name: Clone upstream NaviThingy and compute pkgver
|
||||
run: |
|
||||
git clone --depth=1 https://github.com/vMohammad24/NaviThingy.git NaviThingy
|
||||
cd NaviThingy
|
||||
tag=$(git describe --tags --abbrev=0 | sed 's/^NaviThingy//' | tr -d 'v')
|
||||
rev=$(git rev-list --count HEAD)
|
||||
commit=$(git rev-parse --short HEAD)
|
||||
echo "pkgver=${tag}.r${rev}.${commit}" >> $GITHUB_ENV
|
||||
|
||||
- name: Patch PKGBUILD and regenerate .SRCINFO
|
||||
run: |
|
||||
echo "Using pkgver=${{ env.pkgver }}"
|
||||
sed -i "s/^pkgver=.*/pkgver=${{ env.pkgver }}/" PKGBUILD
|
||||
|
||||
useradd -m builduser
|
||||
chown -R builduser .
|
||||
|
||||
git config --global --add safe.directory "$PWD"
|
||||
|
||||
su builduser -c "makepkg --printsrcinfo > .SRCINFO"
|
||||
|
||||
- name: Push to AUR
|
||||
run: |
|
||||
git remote add aur ssh://aur@aur.archlinux.org/navithingy-git.git
|
||||
git add PKGBUILD .SRCINFO
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit."
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "Update to ${{ env.pkgver }}"
|
||||
git push aur HEAD:master
|
Loading…
Add table
Add a link
Reference in a new issue