commit 6fb995aa30e0101f1f8fe6570106458159aff126 Author: Hunter Wittenborn Date: Mon Jun 28 19:35:23 2021 -0500 Added Drone CLI diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..ff0d449 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,11 @@ +pkgbase = drone-cli-bin + pkgdesc = Command Line Tools for Drone CI (Binary Release) + pkgver = 1.3.0 + pkgrel = 1 + url = https://github.com/drone/drone-cli + arch = x86_64 + license = Apache-2.0 + source_x86_64 = https://github.com/drone/drone-cli/releases/download/v1.3.0/drone_linux_amd64.tar.gz + sha256sums_x86_64 = d6953aa963c2c0b25911fb3d659b78b75060cd2acce53b0e9e16336a30c83706 + +pkgname = drone-cli-bin diff --git a/.update-check.sh b/.update-check.sh new file mode 100755 index 0000000..046111b --- /dev/null +++ b/.update-check.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +# The following packages are needed to function: curl, jq +source PKGBUILD + +api_data="$(curl -sH "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/drone/drone-cli/releases/latest")" + +latest_version="$( echo "${api_data}" | jq -r '.tag_name' | rev | head -c -2 | rev)" + +if [[ "${pkgver}" != "${latest_version}" ]]; then + echo "Updating PKGBUILD info..." + + number=1 + for i in $(echo "${api_data}" | jq -r .assets[].name); do + if [[ "${i}" == "drone_checksums.txt" ]]; then + break + elif [[ "${i}" == "" ]]; then + echo "Couldn't find the checksum file. Aborting..." + exit 1 + fi + + number="$(( "${number}" + 1 ))" + done + + checksum_url="$(echo "${api_data}" | jq -r '.assets[].browser_download_url' | xargs | awk "{print \$$number}")" + checksum_value="$(curl -Ls "${checksum_url}" | grep 'drone_linux_amd64.tar.gz' | awk '{print $1}')" + + sed -i "s|pkgver=.*|pkgver='${latest_version}'|" PKGBUILD + sed -i "s|sha256sums_x86_64=.*|sha256sums_x86_64=('${checksum_value}')|" PKGBUILD +fi + +echo "Done." diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..f9d0aad --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,16 @@ +# Maintainer: Hunter Wittenborn + +pkgname=drone-cli-bin +pkgver='1.3.0' +pkgrel=1 +pkgdesc="Command Line Tools for Drone CI (Binary Release)" +arch=('x86_64') +license=('Apache-2.0') +url="https://github.com/drone/drone-cli" + +source_x86_64=("${url}/releases/download/v${pkgver}/drone_linux_amd64.tar.gz") +sha256sums_x86_64=('d6953aa963c2c0b25911fb3d659b78b75060cd2acce53b0e9e16336a30c83706') + +package() { + install -Dm 555 "${srcdir}/drone" "${pkgdir}/usr/bin/drone" +}