-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (78 loc) · 3.2 KB
/
update_repos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Update repo's and AUR's PKGBUILD
on:
push:
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:
jobs:
update-repo:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: install dependencies
run: |
pacman -Syyu --noconfirm
pacman -S git binutils python python-pip --noconfirm
- name: checkout repo content
uses: actions/checkout@v2
- name: create user
run: |
useradd -m abohiccups
- name: update PKGBUILD
run: |
git clone https://github.com/jlambert360/FPM-AppImage /tmp/FPM-AppImage
cd /tmp/FPM-AppImage
PKGVER="$(git tag | tail -n1)"
TAGNAME="${PKGVER:1}"
git checkout --quiet "$(git rev-list -n 1 $PKGVER)"
APPIMAGE_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/Faster_Project_Plus-x86-64.AppImage | sha256sum | sed 's/ -//')"
LAUNCHER_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/Launcher.tar.gz | sha256sum | sed 's/ -//')"
SD_SHA="$(curl -L https://github.com/jlambert360/FPM-AppImage/releases/download/$PKGVER/sd.tar.gz | sha256sum | sed 's/ -//')"
cd -
sed -i "/pkgver=/c\pkgver=\'$PKGVER\'" ./PKGBUILD
sed -i "/_tagname=/c\_tagname=\'$TAGNAME\'" ./PKGBUILD
sed -i "/sha256sums=/c\sha256sums=(\'$APPIMAGE_SHA\' \'$LAUNCHER_SHA\' \'$SD_SHA\')" ./PKGBUILD
chown -R abohiccups:abohiccups .
su -c "makepkg --printsrcinfo > .SRCINFO" abohiccups
chown -R root:root .
- name: push changes to repo
run: |
git config --global user.name 'ABOhiccups'
git config --global user.email '[email protected]'
git add PKGBUILD .SRCINFO
if [[ `git status --porcelain` ]]; then
git commit -m "automatic: updated PKGBUILD (repo)"
git push
else
echo "Nothing to commit! (repo)"
fi
update-aur:
needs: update-repo
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.AUR_SSH_PRIVATE_KEY }}"
- name: push changes to aur
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
git clone ssh://[email protected]/project-plus-netplay.git /tmp/aur
cp {PKGBUILD,.SRCINFO} /tmp/aur/
cd /tmp/aur
git config --global user.name 'ABOhiccups (github workflow https://github.com/ABOhiccups/project-plus-netplay-PKGBUILD)'
git config --global user.email '[email protected]'
git add PKGBUILD .SRCINFO
if [[ `git status --porcelain` ]]; then
git commit -m "automatic: updated PKGBUILD (AUR)"
git push
else
echo "Nothing to commit! (AUR)"
fi