22# Copyright 2018-2020 the Tectonic Project
33# Licensed under the MIT license
44
5- # Auto-update the Arch Linux AUR repo for Tectonic. This script is invoked in
5+ # Auto-update the Arch Linux AUR repos for Tectonic. This script is invoked in
66# the CI/CD pipeline when a new release of the main Tectonic package has been
7- # made. It must be called *after* the Crates.io package has been updated.
7+ # made. It must be called *after* the Crates.io packages have been updated and
8+ # the GitHub release artifacts have been uploaded.
89
910set -xeuo pipefail
1011cd " $( dirname $0 ) "
@@ -15,29 +16,58 @@ if [ ! -f deploy_key ] ; then
1516fi
1617
1718# Get the settings that we need
19+
1820version=" $( cranko show version tectonic) "
21+
1922url=" https://crates.io/api/v1/crates/tectonic/$version /download"
2023wget -q --progress=dot " $url " -O tectonic.crate.gz
21- sha512=" $( sha512sum tectonic.crate.gz | cut -d' ' -f1) "
24+ source_sha512=" $( sha512sum tectonic.crate.gz | cut -d' ' -f1) "
25+
26+ url=" https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%40$version /tectonic-$version -x86_64-unknown-linux-gnu.tar.gz"
27+ wget -q --progress=dot " $url " -O x86_64.tar.gz
28+ x86_64_sha512=" $( sha512sum x86_64.tar.gz | cut -d' ' -f1) "
29+
30+ url=" https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%40$version /tectonic-$version -arm-unknown-linux-musleabihf.tar.gz"
31+ wget -q --progress=dot " $url " -O armv7h.tar.gz
32+ armv7h_sha512=" $( sha512sum armv7h.tar.gz | cut -d' ' -f1) "
2233
2334# Set up to run makepkg
35+
2436wget https://www.archlinux.org/packages/core/x86_64/pacman/download/ -O pacman.pkg.tar.zst
2537tar -I zstd -xf pacman.pkg.tar.zst
2638bindir=" $( pwd) /usr/bin"
2739export PATH=" $bindir :$PATH "
2840export LIBRARY=" $( pwd) /usr/share/makepkg"
2941config=" $( pwd) /etc/makepkg.conf"
3042
31- # Get the repo
43+ # Get the repos
44+
3245export GIT_SSH_COMMAND=" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $( pwd) /deploy_key"
33- git clone ssh://
[email protected] /tectonic.git aur
46+ git clone ssh://
[email protected] /tectonic.git aur-src
47+ git clone ssh://
[email protected] /tectonic-bin.git aur-bin
48+
49+ # Update them
50+
51+ sed -e " s|@version@|$version |g" \
52+ -e " s|@source_sha512@|$source_sha512 |g" \
53+ PKGBUILD.src.in > aur-src/PKGBUILD
54+
55+ (cd aur-src \
56+ && /bin/bash " $bindir /makepkg" --config=" $config " --printsrcinfo > .SRCINFO \
57+ && git add PKGBUILD .SRCINFO \
58+ && git commit -m " Release $version " )
59+
60+ sed -e " s|@version@|$version |g" \
61+ -e " s|@x86_64_sha512@|$x86_64_sha512 |g" \
62+ -e " s|@armv7h_sha512@|$armv7h_sha512 |g" \
63+ PKGBUILD.bin.in > aur-bin/PKGBUILD
64+
65+ (cd aur-bin \
66+ && /bin/bash " $bindir /makepkg" --config=" $config " --printsrcinfo > .SRCINFO \
67+ && git add PKGBUILD .SRCINFO \
68+ && git commit -m " Release $version " )
3469
35- # Update it
36- sed -e " s|@version@|$version |g" -e " s|@sha512@|$sha512 |g" PKGBUILD.in > aur/PKGBUILD
37- cd aur
38- /bin/bash " $bindir /makepkg" --config=" $config " --printsrcinfo > .SRCINFO
39- git add PKGBUILD .SRCINFO
40- git commit -m " Release $version "
70+ # Deploy
4171
42- # Deploy to AUR
43- git push origin master
72+ (cd aur-src && git push origin master)
73+ (cd aur-bin && git push origin master)
0 commit comments