Version: 5

Template: github
Owner: pgbackrest
Project: pgbackrest
Custom-Version: release/@ANY_VERSION@
# The GitHub template fetches
#
#    https://api.github.com/repos/<user>/<project>/git/matching-refs/tags/
#
# which contains URLs to the various tags on the GitHub-hosted repo. These URLs
# are of the form
#
#    https://api.github.com/repos/<owner>/<repo>/git/refs/tags/<tag>.
#
# The template sets Download-Url-Mangle to
#
#     s%(api.github.com/repos/[^/]+/[^/]+)/git/refs/%$1/tarball/refs/%g
#
# (see man 5 debian-watch) which converts the URL to
#
#    https://api.github.com/repos/<owner>/<repo>/tarball/refs/<tag>
#
# which downloads a repository archive of <tag>.
#
# This overrides the Download-Url-Mangle to instead convert the URL to a named
# release asset:
#
# https://github.com/<owner>/<repo>/releases/download/<tag>/pgbackreset-$2.tar.gz
#
Download-Url-Mangle: s%api.github.com/repos/([^/]+/[^/]+)/git/refs/tags/release/@ANY_VERSION@%github.com/$1/releases/download/release/$2/@PACKAGE@-$2.tar.gz%g
