]> Cypherpunks.ru repositories - goredo.git/blob - makedist.sh
Fix tests permissions
[goredo.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/goredo-$release
9 cd $tmp/goredo-$release
10 git checkout v$release
11
12 redo-ifchange VERSION
13
14 ########################################################################
15 cd doc
16 cat > download.texi <<EOF
17 You can obtain releases source code prepared tarballs on
18 @url{http://www.goredo.cypherpunks.ru/}.
19 EOF
20
21 mkinfo() {
22     ${MAKEINFO:-makeinfo} --plaintext \
23         --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
24         --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
25         -D "VERSION `cat ../VERSION`" $@
26 }
27
28 texi=$(mktemp)
29
30 cat > $texi <<EOF
31 \input texinfo
32 @documentencoding UTF-8
33 @settitle NEWS
34 @node News
35 @unnumbered News
36 `sed -n '3,$p' < news.texi`
37 @bye
38 EOF
39 mkinfo --output NEWS $texi
40
41 cat > $texi <<EOF
42 \input texinfo
43 @documentencoding UTF-8
44 @settitle INSTALL
45 @include install.texi
46 @bye
47 EOF
48 perl -i -p -e "s/.verbatiminclude .*PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
49 mkinfo --output INSTALL $texi
50
51 cat > $texi <<EOF
52 \input texinfo
53 @documentencoding UTF-8
54 @settitle THANKS
55 `cat thanks.texi`
56 @bye
57 EOF
58 mkinfo --output THANKS $texi
59
60 rm $texi
61 redo goredo.info
62 mv goredo.info INSTALL NEWS THANKS ..
63 cd ..
64
65 ########################################################################
66
67 mkdir -p src
68 mv *.go go.* src
69 cd src
70 go mod vendor
71 modvendor -v -copy="**/*_test.go **/private-gen.go **/main.go **/vectors.json **/gen.go"
72 rm -rf vendor/golang.org/x/sys/plan9 vendor/golang.org/x/sys/windows
73 find vendor/golang.org/x/sys -name "*_test.go" -delete
74 find . \( -name .gitignore -o -name .travis.yml \) -delete
75
76 rm vendor/lukechampine.com/blake3/cpu_darwin.go
77 sed -n -i.tmp '3,$p' vendor/lukechampine.com/blake3/cpu.go
78 rm vendor/lukechampine.com/blake3/cpu.go.tmp
79
80 cd ..
81
82 ########################################################################
83
84 rm -rf *.texi .redo .git .gitignore doc makedist.sh VERSION.do
85 find . -type d -exec chmod 755 {} \;
86 find . -type f -exec chmod 644 {} \;
87 find t/redo-sh.tests -name test -exec chmod +x {} \+
88 find t -name wrapper.rc -exec chmod +x {} \+
89 chmod +x t/apenwarr/sleep t/goredo-*.t
90
91 cd ..
92 tar cvf goredo-"$release".tar --uid=0 --gid=0 --numeric-owner goredo-"$release"
93 zstd -19 -v goredo-"$release".tar
94 gpg --detach-sign --sign --local-user 3A528DDE952C7E93 goredo-"$release".tar.zst
95
96 tarball=goredo-"$release".tar.zst
97 size=$(( $(stat -f %z $tarball) / 1024 ))
98 hash=$(gpg --print-md SHA256 < $tarball)
99 release_date=$(date "+%Y-%m-%d")
100
101 cat <<EOF
102 An entry for documentation:
103 @item @ref{Release $release, $release} @tab $release_date @tab $size KiB
104 @tab @url{download/goredo-${release}.tar.zst, link} @url{download/goredo-${release}.tar.zst.sig, sign}
105 @tab @code{$hash}
106 EOF
107
108 mv $tmp/$tarball $tmp/"$tarball".sig $cur/doc/goredo.html/download
109
110 cat <<EOF
111 Subject: goredo $release release announcement
112
113 I am pleased to announce goredo $release release availability!
114
115 goredo is redo implementation on pure Go.
116
117 ------------------------ >8 ------------------------
118
119 The main improvements for that release are:
120
121
122 ------------------------ >8 ------------------------
123
124 goredo's home page is: http://www.goredo.cypherpunks.ru/
125
126 Source code and its signature for that version can be found here:
127
128     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst ($size KiB)
129     http://www.goredo.cypherpunks.ru/download/goredo-${release}.tar.zst.sig
130
131 SHA256 hash: $hash
132 GPG key ID: 0x3A528DDE952C7E93 goredo releases <goredo@cypherpunks.ru>
133 Fingerprint: 7531 BB84 FAF0 BF35 960C  63B9 3A52 8DDE 952C 7E93
134
135 Please send questions regarding the use of goredo, bug reports and patches
136 to mailing list: https://lists.cypherpunks.ru/pipermail/goredo-devel/
137 EOF