summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Qing(robot)2022-09-29 23:25:23 +0800
committerHe Qing(robot)2022-09-29 23:25:23 +0800
commitff049860d6fd31a02c2004add4d5f0c7ef38afb0 (patch)
tree90a7d6f451bd2e9c09dd17b046e14a2f6fd120f1
parent7e5591017415c36e32a399e35099006e0cfc5004 (diff)
downloadaur-ff049860d6fd31a02c2004add4d5f0c7ef38afb0.tar.gz
add auto update script
-rw-r--r--.SRCINFO.tpl23
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD.tpl22
-rwxr-xr-xauto_update_version.sh37
4 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO.tpl b/.SRCINFO.tpl
new file mode 100644
index 000000000000..b8dbd100ec21
--- /dev/null
+++ b/.SRCINFO.tpl
@@ -0,0 +1,23 @@
+pkgbase = leapp-bin
+ pkgdesc = Leapp is a Desktop DevTool that handles the management and security of your cloud credentials for you, converted from .deb package
+ pkgver = VERSION
+ pkgrel = 1
+ url = https://www.leapp.cloud/
+ arch = x86_64
+ license = custom
+ depends = gtk3
+ depends = libxss
+ depends = libnotify
+ depends = nss
+ depends = libxss
+ depends = libxtst
+ depends = xdg-utils
+ depends = util-linux-libs
+ depends = libsecret
+ depends = at-spi2-core
+ depends = aws-session-manager-plugin
+ provides = leapp
+ source = Leapp_VERSION_amd64.deb::https://asset.noovolari.com/VERSION/Leapp_VERSION_amd64.deb
+ sha512sums = SHA512SUMS
+
+pkgname = leapp-bin
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..a0d546bd9653
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+exist_vers
diff --git a/PKGBUILD.tpl b/PKGBUILD.tpl
new file mode 100644
index 000000000000..0d1f7609449d
--- /dev/null
+++ b/PKGBUILD.tpl
@@ -0,0 +1,22 @@
+# Maintainer: He Qing <qing@he.email>
+
+pkgname=leapp-bin
+_pkgname=leapp
+pkgver=VERSION
+_pkgdate=20220112
+pkgrel=1
+pkgdesc="Leapp is a Desktop DevTool that handles the management and security of your cloud credentials for you, converted from .deb package"
+arch=("x86_64")
+url="https://www.leapp.cloud/"
+license=('custom')
+depends=('gtk3' 'libxss' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'util-linux-libs' 'libsecret' 'at-spi2-core' 'aws-session-manager-plugin')
+provides=("$_pkgname")
+source=(
+ "Leapp_${pkgver}_amd64.deb::https://asset.noovolari.com/${pkgver}/Leapp_${pkgver}_amd64.deb"
+)
+sha512sums=('SHA512SUMS')
+
+package() {
+ cd ${srcdir}
+ tar -xvf data.tar.xz -C "${pkgdir}"
+}
diff --git a/auto_update_version.sh b/auto_update_version.sh
new file mode 100755
index 000000000000..6346378adce0
--- /dev/null
+++ b/auto_update_version.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# use crontab to auto update version
+# */7 * * * * ./auto_update_version.sh
+# get the latest release from github and commit change to aur
+
+cd $( dirname -- "$( readlink -f -- "$0" )" )
+
+aur_ver=$(cat PKGBUILD | grep "^pkgver=" | sed 's/pkgver=//')
+github_ver=$(curl --max-time 5 -sL https://api.github.com/repos/Noovolari/leapp/releases/latest | jq -r ".tag_name" | sed 's/v//g')
+
+if [ -z ${github_ver} ] || [ -z ${aur_ver} ]; then
+ echo "runing error, could not get the right version" && exit 1
+fi
+
+if [ "${aur_ver}" == "${github_ver}" ]; then
+ echo "leapp in aur already has the latest version."
+else
+ for exist_ver in `cat exist_vers`; do
+ if [ "${exist_ver}" == "${github_ver}" ]; then
+ echo "looks like the latest release from github is already exist." && exit 2
+ fi
+ done
+ rm -f Leapp_*_amd64.deb
+ wget https://asset.noovolari.com/${github_ver}/Leapp_${github_ver}_amd64.deb || echo "can't download https://asset.noovolari.com/${github_ver}/Leapp_${github_ver}_amd64.deb" && exit 3
+ sha512sum=$(sha512sum Leapp_${github_ver}_amd64.deb | awk '{printf $1}')
+ cp PKGBUILD.tpl PKGBUILD
+ cp .SRCINFO.tpl .SRCINFO
+ sed -i "s/VERSION/${github_ver}/g" PKGBUILD
+ sed -i "s/VERSION/${github_ver}/g" .SRCINFO
+ sed -i "s/SHA512SUMS/${sha512sum}/g" PKGBUILD
+ sed -i "s/SHA512SUMS/${sha512sum}/g" .SRCINFO
+ git add .SRCINFO PKGBUILD
+ git commit -m "auto update to ${github_ver}"
+ git push
+ rm -f Leapp_${github_ver}_amd64.deb
+ echo "${github_ver}" >> exist_vers
+fi