blob: b05cbbefcc1595dd715cd059fe5bea83929babab (
plain)
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
|
#!/bin/bash
CI_MODE=false
if [[ "$*" == *"--ci"* ]]; then
CI_MODE=true
echo "Running in CI mode - will skip commit operations"
fi
latest_version=$(
curl -sI -o /dev/null -w '%{redirect_url}' 'https://github.com/nexu-io/open-design/releases/latest' \
| sed -E 's#.*/open-design-v##;s/\r$//'
)
echo "Latest open-design version: ${latest_version}"
sed -i "s/^pkgver=.*$/pkgver=${latest_version}/" ./PKGBUILD
if ! git diff --quiet HEAD PKGBUILD; then
if pacman -Qi pacman-contrib > /dev/null 2>&1; then
updpkgsums
else
echo "Install pacman-contrib with 'pacman -S pacman-contrib'"
exit 1
fi
makepkg --printsrcinfo > .SRCINFO
makepkg -si
if [ "$CI_MODE" = false ]; then
# Only commit if not in CI mode
git add PKGBUILD .SRCINFO
git commit -m "Updated version to ${latest_version}"
git push origin master
else
echo "Skipping commit in CI mode"
fi
else
echo "No updates found!"
fi
|