mirror of
https://github.com/archlinux/aur.git
synced 2026-02-09 06:38:44 +01:00
Automated build and publish via GitHub Actions. Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
43 lines
No EOL
1.2 KiB
Bash
43 lines
No EOL
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
pkg_detect_latest() {
|
|
local api_url="https://api.github.com/repos/SlotSun/dart_simple_live/releases"
|
|
local version
|
|
version="$(curl -fsSL "${api_url}" | jq -r '.[0].tag_name | ltrimstr("v")')"
|
|
if [[ -z "${version}" ]]; then
|
|
echo "Failed to parse version from API response" >&2
|
|
return 1
|
|
fi
|
|
|
|
printf '%s\n' "${version}"
|
|
}
|
|
|
|
pkg_get_update_params() {
|
|
local version="$1"
|
|
local base_url="https://github.com/SlotSun/dart_simple_live/archive/refs/tags"
|
|
local filename="v${version}.tar.gz"
|
|
local url="${base_url}/${filename}"
|
|
sha256="SKIP"
|
|
|
|
|
|
# Return: url filename pkgver hash_algo checksum
|
|
printf '%s %s %s %s %s\n' "${url}" "${filename}" "${version}" "sha256" "${sha256}"
|
|
}
|
|
|
|
pkg_update_files() {
|
|
local url="$1"
|
|
local filename="$2"
|
|
local pkgver="$3"
|
|
local hash_algo="$4"
|
|
local checksum="$5"
|
|
local pkgbuild="${PKG_DIR}/PKGBUILD"
|
|
|
|
local base_url="${url%/*}"
|
|
local url_x86_64="${base_url}/${filename}"
|
|
|
|
sed -i "s/^pkgver=.*/pkgver=${pkgver}/" "${pkgbuild}"
|
|
sed -i "s/^pkgrel=.*/pkgrel=1/" "${pkgbuild}"
|
|
sed -i "s|^source=(\".*\")|source=(\"${filename}::${url_x86_64}\")|" "${pkgbuild}"
|
|
|
|
echo "Warning: Only x86_64 checksum updated. Please verify aarch64 manually." >&2
|
|
} |