summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelio Loureiro2023-12-23 17:55:44 +0100
committerHelio Loureiro2023-12-23 17:55:44 +0100
commit567c02d3a461cefa0ead7584b3792a58bbfc0955 (patch)
treeda68534466bbb152ec576633c4cea45f34273870
parentb430c4e9aeab4dad3e26947b5710abdf883f6daf (diff)
downloadaur-567c02d3a461cefa0ead7584b3792a58bbfc0955.tar.gz
Step up to version 4.14.1
## What's Changed * Fix protect_content hint * Sending InputFile fix * Fix ExceptionHandler handle() method as async for async telebot * Update the available content_types in README
-rwxr-xr-x.SRCINFO6
-rwxr-xr-xPKGBUILD4
-rwxr-xr-xauto-update.sh73
3 files changed, 78 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a3689902b143..ae9e5036578d 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = python-pytelegrambotapi
pkgdesc = Python Telegram bot api
- pkgver = 4.14.0
+ pkgver = 4.14.1
pkgrel = 1
url = https://github.com/eternnoir/pyTelegramBotAPI
arch = any
@@ -10,7 +10,7 @@ pkgbase = python-pytelegrambotapi
depends = python-pytest
depends = python-wheel
depends = python-aiohttp
- source = https://github.com/eternnoir/pyTelegramBotAPI/archive/refs/tags/4.14.0.tar.gz
- sha256sums = 520b41e0d31505e83f766f411b748fd7a98beace6ee739317b35aa4fd9d32fe0
+ source = https://github.com/eternnoir/pyTelegramBotAPI/archive/refs/tags/4.14.1.tar.gz
+ sha256sums = ef21a09d74e582b24750df06cbbe9738f218068b7d254423fc3b1c1f7cd9440a
pkgname = python-pytelegrambotapi
diff --git a/PKGBUILD b/PKGBUILD
index 934ac33c2677..18f4249fb536 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=python-pytelegrambotapi
_pkgname=pyTelegramBotAPI
-pkgver=4.14.0
+pkgver=4.14.1
pkgrel=1
pkgdesc="Python Telegram bot api"
arch=('any')
@@ -11,7 +11,7 @@ url="https://github.com/eternnoir/pyTelegramBotAPI"
license=("GPLv2")
depends=('python' 'python-requests' 'python-pytest' 'python-wheel' 'python-aiohttp')
source=("https://github.com/eternnoir/${_pkgname}/archive/refs/tags/${pkgver}.tar.gz")
-sha256sums=('520b41e0d31505e83f766f411b748fd7a98beace6ee739317b35aa4fd9d32fe0')
+sha256sums=('ef21a09d74e582b24750df06cbbe9738f218068b7d254423fc3b1c1f7cd9440a')
package() {
cd ${srcdir}/${_pkgname}-${pkgver}/
diff --git a/auto-update.sh b/auto-update.sh
new file mode 100755
index 000000000000..f34de3b58dac
--- /dev/null
+++ b/auto-update.sh
@@ -0,0 +1,73 @@
+#! /usr/bin/env bash
+#
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+## "https://github.com/eternnoir/pyTelegramBotAPI/releases/"
+URL="https://api.github.com/repos/eternnoir/pyTelegramBotAPI/releases"
+
+if [ -z "$GITHUB_TOKEN" ]; then
+ die "Missing GITHUB_TOKEN to access API."
+fi
+
+temp_file=$(mktemp)
+trap "rm -f $tempfile" 1 2 3 6 13 15
+ # From example: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release
+curl -sL \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ $URL/latest > $temp_file || \
+ die "Failed to fetch data from latest release"
+
+tag_name=$(jq -r .tag_name < $temp_file)
+echo "tag_name: $tag_name"
+
+current_tag=$(grep "^pkgver" PKGBUILD | cut -d= -f2)
+echo "current_tag: $current_tag"
+
+if [ "$current_tag" = "$tag_name" ];then
+ echo "Same versions. Nothing to be done."
+ rm -f $temp_file
+ exit 0
+fi
+
+cat $temp_file
+
+echo "Updating AUR package to: $tag_name"
+pkgname=$(grep "^_pkgname=" PKGBUILD | cut -d= -f2)
+tarball_url="https://github.com/eternnoir/${pkgname}/archive/refs/tags/${tag_name}.tar.gz"
+## sed part to remove windowze comments
+release_message=$(jq -r .body < $temp_file | sed "s/\\\r//g")
+
+echo "tarball_url: $tarball_url"
+echo "release_message: $release_message"
+
+echo "Downloading latest release"
+curl -Lo $temp_file "$tarball_url" || \
+ die "Failed to download latest release"
+echo "Getting sha256 sum"
+sha256=$(sha256sum $temp_file | cut -d' ' -f1)
+echo "sha256: $sha256"
+
+echo "Updating version into PKGBUILD"
+sed -i "s/pkgver=.*/pkgver=$tag_name/" PKGBUILD || \
+ die "Failed to update version into PKGBUILD"
+echo "Updating hash into PKGBUILD"
+sed -i "s/sha256sums=.*/sha256sums=\(\'$sha256\'\)/" PKGBUILD || \
+ die "Failed to update sha256sum into PKGBUILD"
+
+echo "Updating .SRCINFO"
+makepkg --printsrcinfo > .SRCINFO || \
+ die "Failed to update .SRCINFO"
+
+echo "Generating package"
+makepkg || \
+ die "Failed to generate package"
+
+echo "Creating git commit message"
+git commit -m "Step up to version $tag_name" -m "$release_message" -a
+
+rm -f $temp_file