]> Cypherpunks.ru repositories - gocheese.git/blob - makedist.sh
Download link for 3.0.0 release
[gocheese.git] / makedist.sh
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 CLOSE_QUOTE_SYMBOL=\" \
28         --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
29         -D "VERSION `cat ../VERSION`" $@
30 }
31
32 texi=$(mktemp)
33 cat > $texi <<EOF
34 \input texinfo
35 @documentencoding UTF-8
36 @settitle INSTALL
37 @include install.texi
38 @bye
39 EOF
40 perl -i -p -e "s/.verbatiminclude ...PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
41 mkinfo --output ../INSTALL $texi
42 rm $texi
43 cd ..
44
45 rm -rf .git .gitignore doc/.gitignore doc/style.css makedist.sh doc/www.do VERSION.do
46 redo-cleanup full
47 perl -i -npe "s/go} build/go} build -mod=vendor/" gocheese.do
48 perl -i -npe "s/go} test/go} test -mod=vendor/" test.do
49 cp ~/work/redo/minimal/do contrib/do
50
51 find . -type d -exec chmod 755 {} +
52 find . -type f -exec chmod 644 {} +
53 chmod +x contrib/pyshop2packages.sh contrib/do
54
55 cd ..
56 tar cvf gocheese-"$release".tar --uid=0 --gid=0 --numeric-owner gocheese-"$release"
57 zstd -19 -v gocheese-"$release".tar
58 gpg --detach-sign --sign --local-user CD5CD01F55343D88 gocheese-"$release".tar.zst
59
60 tarball=gocheese-"$release".tar.zst
61 size=$(( $(stat -f %z $tarball) / 1024 ))
62 hash=$(gpg --print-md SHA256 < $tarball)
63 release_date=$(date "+%Y-%m-%d")
64
65 cat <<EOF
66 An entry for documentation:
67 @item $release @tab $release_date @tab $size KiB
68 @tab @url{download/gocheese-${release}.tar.zst, link}
69      @url{download/gocheese-${release}.tar.zst.sig, sign}
70 @tab @code{$hash}
71 EOF
72
73 mv $tmp/$tarball $tmp/"$tarball".sig $cur/doc/gocheese.html/download