-
Notifications
You must be signed in to change notification settings - Fork 8
/
script
executable file
·186 lines (166 loc) · 9.71 KB
/
script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/env sh
# Make the tag in ziglang/zig and ziglang/zig-bootstrap
# Edit the version numbers in:
# * CMakeLists.txt
# * build.zig
# Make commit to start the next release cycle
# Programs needed: 7z s3cmd xz
RELDIR=$(pwd)
TAGVER=0.10.0
BOOTSTRAP_SRC="$HOME/dev/bootstrap-zig"
# This must have zig built for the tagged release, along with having run `./zig build docs`.
REL_SRC_BUILD="$HOME/tmp/zig/build-release"
set -e
set -x
cd "$BOOTSTRAP_SRC"
./build -j12 aarch64-linux-musl baseline
./build -j12 x86_64-linux-musl baseline
./build -j12 i386-linux-musl baseline
./build -j12 riscv64-linux-musl baseline
./build -j12 arm-linux-musleabihf generic+v7a
./build -j12 x86_64-macos-none baseline
./build -j12 aarch64-macos-none apple_a14
./build -j12 x86_64-windows-gnu baseline
./build -j12 i386-windows-gnu baseline
./build -j12 aarch64-windows-gnu baseline
# on a freebsd server
# ./build -j$(sysctl hw.ncpu) x86_64-native baseline
mkdir -p $RELDIR/tmp
cd $RELDIR/tmp
git clone https://github.com/ziglang/zig/
cd zig
git archive --format=tar.xz -o $RELDIR/zig-$TAGVER.tar.xz --prefix=zig-$TAGVER/ $TAGVER
mkdir -p $RELDIR/tmp
cd $RELDIR/tmp
git clone https://github.com/ziglang/zig-bootstrap
cd zig-bootstrap
git archive --format=tar.xz -o $RELDIR/zig-bootstrap-$TAGVER.tar.xz --prefix=zig-bootstrap-$TAGVER/ $TAGVER
cd $RELDIR
rm -rf tmp/
cp -r $BOOTSTRAP_SRC/out/zig-aarch64-linux-musl-baseline zig-linux-aarch64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-aarch64-macos-none-apple_a14 zig-macos-aarch64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-aarch64-windows-gnu-baseline zig-windows-aarch64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-arm-linux-musleabihf-generic+v7a zig-linux-armv7a-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-i386-linux-musl-baseline zig-linux-i386-$TAGVER/
#cp -r $BOOTSTRAP_SRC/out/zig-i386-windows-gnu-baseline zig-windows-i386-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-riscv64-linux-musl-baseline zig-linux-riscv64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-x86_64-freebsd-gnu-baseline zig-freebsd-x86_64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-x86_64-linux-musl-baseline zig-linux-x86_64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-x86_64-macos-none-baseline zig-macos-x86_64-$TAGVER/
cp -r $BOOTSTRAP_SRC/out/zig-x86_64-windows-gnu-baseline zig-windows-x86_64-$TAGVER/
mv zig-linux-aarch64-$TAGVER/{bin/,}zig
mv zig-linux-armv7a-$TAGVER/{bin/,}zig
mv zig-linux-i386-$TAGVER/{bin/,}zig
mv zig-linux-riscv64-$TAGVER/{bin/,}zig
mv zig-linux-x86_64-$TAGVER/{bin/,}zig
#mv zig-windows-i386-$TAGVER/{bin/,}zig.exe
mv zig-windows-x86_64-$TAGVER/{bin/,}zig.exe
mv zig-windows-aarch64-$TAGVER/{bin/,}zig.exe
mv zig-macos-aarch64-$TAGVER/{bin/,}zig
mv zig-macos-x86_64-$TAGVER/{bin/,}zig
mv zig-freebsd-x86_64-$TAGVER/{bin/,}zig
mv zig-linux-aarch64-$TAGVER/{lib,lib2}
mv zig-linux-armv7a-$TAGVER/{lib,lib2}
mv zig-linux-i386-$TAGVER/{lib,lib2}
mv zig-linux-riscv64-$TAGVER/{lib,lib2}
mv zig-linux-x86_64-$TAGVER/{lib,lib2}
#mv zig-windows-i386-$TAGVER/{lib,lib2}
mv zig-windows-x86_64-$TAGVER/{lib,lib2}
mv zig-windows-aarch64-$TAGVER/{lib,lib2}
mv zig-macos-aarch64-$TAGVER/{lib,lib2}
mv zig-macos-x86_64-$TAGVER/{lib,lib2}
mv zig-freebsd-x86_64-$TAGVER/{lib,lib2}
mv zig-linux-aarch64-$TAGVER/{lib2/zig,lib}
mv zig-linux-armv7a-$TAGVER/{lib2/zig,lib}
mv zig-linux-i386-$TAGVER/{lib2/zig,lib}
mv zig-linux-riscv64-$TAGVER/{lib2/zig,lib}
mv zig-linux-x86_64-$TAGVER/{lib2/zig,lib}
#mv zig-windows-i386-$TAGVER/{lib2/zig,lib}
mv zig-windows-x86_64-$TAGVER/{lib2/zig,lib}
mv zig-windows-aarch64-$TAGVER/{lib2/zig,lib}
mv zig-macos-aarch64-$TAGVER/{lib2/zig,lib}
mv zig-macos-x86_64-$TAGVER/{lib2/zig,lib}
mv zig-freebsd-x86_64-$TAGVER/{lib2/zig,lib}
rmdir zig-linux-aarch64-$TAGVER/{bin,lib2}
rmdir zig-linux-armv7a-$TAGVER/{bin,lib2}
rmdir zig-linux-i386-$TAGVER/{bin,lib2}
rmdir zig-linux-riscv64-$TAGVER/{bin,lib2}
rmdir zig-linux-x86_64-$TAGVER/{bin,lib2}
#rmdir zig-windows-i386-$TAGVER/{bin,lib2}
rmdir zig-windows-x86_64-$TAGVER/{bin,lib2}
rmdir zig-windows-aarch64-$TAGVER/{bin,lib2}
rmdir zig-macos-aarch64-$TAGVER/{bin,lib2}
rmdir zig-macos-x86_64-$TAGVER/{bin,lib2}
rmdir zig-freebsd-x86_64-$TAGVER/{bin,lib2}
cp $REL_SRC_BUILD/../LICENSE zig-linux-aarch64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-linux-armv7a-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-linux-i386-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-linux-riscv64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-linux-x86_64-$TAGVER/
#cp $REL_SRC_BUILD/../LICENSE zig-windows-i386-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-windows-x86_64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-windows-aarch64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-macos-aarch64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-macos-x86_64-$TAGVER/
cp $REL_SRC_BUILD/../LICENSE zig-freebsd-x86_64-$TAGVER/
cd $REL_SRC_BUILD
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-aarch64 -target aarch64-linux-musl -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-armv7a -target arm-linux-musl -mcpu=generic+v7a -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-i386 -target i386-linux-musl -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-riscv64 -target riscv64-linux-musl -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-linux-x86_64 -target x86_64-linux-musl -fno-emit-bin
#stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-i386 -target i386-windows-gnu -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-x86_64 -target x86_64-windows-gnu -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-windows-aarch64 -target aarch64-windows-gnu -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-x86_64 -target x86_64-macos -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-macos-aarch64 -target aarch64-macos -fno-emit-bin
stage3/bin/zig test ../lib/std/std.zig -femit-docs=doc-freebsd-x86_64 -target x86_64-freebsd -fno-emit-bin
cd $RELDIR
cp -r $REL_SRC_BUILD/doc-linux-aarch64 zig-linux-aarch64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-linux-armv7a zig-linux-armv7a-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-linux-i386 zig-linux-i386-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-linux-riscv64 zig-linux-riscv64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-linux-x86_64 zig-linux-x86_64-$TAGVER/doc/std
#cp -r $REL_SRC_BUILD/doc-windows-i386 zig-windows-i386-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-windows-x86_64 zig-windows-x86_64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-windows-aarch64 zig-windows-aarch64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-macos-aarch64 zig-macos-aarch64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-macos-x86_64 zig-macos-x86_64-$TAGVER/doc/std
cp -r $REL_SRC_BUILD/doc-freebsd-x86_64 zig-freebsd-x86_64-$TAGVER/doc/std
#rm -rf zig-linux-aarch64-$TAGVER/doc/std/src
#rm -rf zig-linux-armv7a-$TAGVER/doc/std/src
#rm -rf zig-linux-i386-$TAGVER/doc/std/src
#rm -rf zig-linux-riscv64-$TAGVER/doc/std/src
#rm -rf zig-linux-x86_64-$TAGVER/doc/std/src
##rm -rf zig-windows-i386-$TAGVER/doc/std/src
#rm -rf zig-windows-x86_64-$TAGVER/doc/std/src
#rm -rf zig-windows-aarch64-$TAGVER/doc/std/src
#rm -rf zig-macos-aarch64-$TAGVER/doc/std/src
#rm -rf zig-macos-x86_64-$TAGVER/doc/std/src
#rm -rf zig-freebsd-x86_64-$TAGVER/doc/std/src
tar cJf zig-linux-aarch64-$TAGVER.tar.xz zig-linux-aarch64-$TAGVER/
tar cJf zig-linux-armv7a-$TAGVER.tar.xz zig-linux-armv7a-$TAGVER/
tar cJf zig-linux-i386-$TAGVER.tar.xz zig-linux-i386-$TAGVER/
tar cJf zig-linux-riscv64-$TAGVER.tar.xz zig-linux-riscv64-$TAGVER/
tar cJf zig-linux-x86_64-$TAGVER.tar.xz zig-linux-x86_64-$TAGVER/
#7z a zig-windows-i386-$TAGVER.zip zig-windows-i386-$TAGVER/
7z a zig-windows-x86_64-$TAGVER.zip zig-windows-x86_64-$TAGVER/
7z a zig-windows-aarch64-$TAGVER.zip zig-windows-aarch64-$TAGVER/
tar cJf zig-macos-aarch64-$TAGVER.tar.xz zig-macos-aarch64-$TAGVER/
tar cJf zig-macos-x86_64-$TAGVER.tar.xz zig-macos-x86_64-$TAGVER/
tar cJf zig-freebsd-x86_64-$TAGVER.tar.xz zig-freebsd-x86_64-$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-bootstrap-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-linux-aarch64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-linux-armv7a-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-linux-i386-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-linux-riscv64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-linux-x86_64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
#s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-windows-i386-$TAGVER.zip s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-windows-x86_64-$TAGVER.zip s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-windows-aarch64-$TAGVER.zip s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-macos-aarch64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-macos-x86_64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" zig-freebsd-x86_64-$TAGVER.tar.xz s3://ziglang.org/download/$TAGVER/
sha256sum *.tar.xz *.zip
ls -l *.tar.xz *.zip