]> Cypherpunks.ru repositories - gocheese.git/blob - makedist
More convenient trusted-host
[gocheese.git] / makedist
1 #!/bin/sh -ex
2
3 cur=$(pwd)
4 tmp=$(mktemp -d)
5 release=$1
6 [ -n "$release" ]
7
8 git clone . $tmp/gocheese-$release
9 cd $tmp/gocheese-$release
10 git checkout v$release
11
12 redo-ifchange VERSION
13
14 go mod vendor
15
16 cat > doc/download.texi <<EOF
17 You can obtain releases source code prepared tarballs on
18 @url{http://www.gocheese.cypherpunks.ru/}.
19 EOF
20 redo doc/gocheese.info
21
22 cd doc
23 mkinfo() {
24     ${MAKEINFO:=makeinfo} --plaintext \
25         --set-customization-variable SECTION_NAME_IN_TITLE=1 \
26         --set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \
27         --set-customization-variable ASCII_PUNCTUATION=1 \
28         -D "VERSION `cat ../VERSION`" $@
29 }
30
31 texi=$(mktemp)
32 cat > $texi <<EOF
33 \input texinfo
34 @documentencoding UTF-8
35 @settitle INSTALL
36 @include install.texi
37 @bye
38 EOF
39 mkinfo --output ../INSTALL $texi
40 rm $texi
41 cd ..
42
43 rm -rf .git .gitignore doc/.gitignore doc/style.css makedist doc/www.do VERSION.do
44 redo-cleanup full
45
46 find . -type d -exec chmod 755 {} +
47 find . -type f -exec chmod 644 {} +
48 chmod +x contrib/pyshop2packages.sh
49
50 cd ..
51 tar cvf gocheese-"$release".tar --uid=0 --gid=0 --numeric-owner gocheese-"$release"
52 zstd -19 -v gocheese-"$release".tar
53 tarball=gocheese-"$release".tar.zst
54 ssh-keygen -Y sign -f ~/.ssh/sign/gocheese@cypherpunks.ru -n file $tarball
55 gpg --armor --detach-sign --sign --local-user CD5CD01F55343D88 $tarball
56 meta4-create -fn "$tarball" -mtime "$tarball" \
57     -sig-pgp "$tarball".asc -sig-ssh "$tarball".sig \
58     http://www.gocheese.cypherpunks.ru/download/"$tarball" \
59     http://y.www.gocheese.cypherpunks.ru/download/"$tarball" < "$tarball" > "$tarball".meta4
60
61 size=$(( $(stat -f %z $tarball) / 1024 ))
62 release_date=$(date "+%Y-%m-%d")
63
64 cat <<EOF
65 An entry for documentation:
66 @item $release @tab $release_date @tab $size KiB @tab
67 @url{download/gocheese-${release}.tar.zst.meta4, meta4}
68 @url{download/gocheese-${release}.tar.zst, tar}
69 @url{download/gocheese-${release}.tar.zst.asc, pgp}
70 @url{download/gocheese-${release}.tar.zst.sig, ssh}
71 EOF
72
73 mv $tmp/$tarball $tmp/"$tarball".asc $tmp/"$tarball".sig $tmp/"$tarball".meta4 $cur/doc/gocheese.html/download