2018-11-04 13:24:46 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ "${BUILD_REASON}" != "PullRequest" ]; then
|
|
|
|
cd "$ZIGBUILDDIR"
|
|
|
|
|
2019-09-22 16:47:07 -07:00
|
|
|
mv ../LICENSE dist/
|
|
|
|
mv ../zig-cache/langref.html dist/
|
|
|
|
mv dist/bin/zig.exe dist/
|
|
|
|
rmdir dist/bin
|
2018-11-04 13:24:46 -08:00
|
|
|
|
2019-09-22 16:47:07 -07:00
|
|
|
VERSION=$(dist/zig.exe version)
|
2018-11-04 13:24:46 -08:00
|
|
|
DIRNAME="zig-windows-x86_64-$VERSION"
|
|
|
|
TARBALL="$DIRNAME.zip"
|
2019-09-22 16:47:07 -07:00
|
|
|
mv dist "$DIRNAME"
|
2018-11-05 10:26:46 -08:00
|
|
|
7z a "$TARBALL" "$DIRNAME"
|
2018-11-04 13:24:46 -08:00
|
|
|
|
|
|
|
mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg"
|
2019-06-04 17:29:38 -07:00
|
|
|
s3cmd put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/
|
2018-11-04 13:24:46 -08:00
|
|
|
|
2018-11-04 20:26:23 -08:00
|
|
|
SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1)
|
2018-11-04 13:24:46 -08:00
|
|
|
BYTESIZE=$(wc -c < $TARBALL)
|
2019-03-20 20:19:18 -07:00
|
|
|
|
|
|
|
JSONFILE="windows-$GITBRANCH.json"
|
|
|
|
touch $JSONFILE
|
|
|
|
echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
|
|
|
|
echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
|
|
|
|
echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
|
|
|
|
|
2019-04-03 13:04:24 -07:00
|
|
|
s3cmd put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE"
|
2019-03-20 20:19:18 -07:00
|
|
|
s3cmd put -P "$JSONFILE" "s3://ziglang.org/builds/windows-$VERSION.json"
|
|
|
|
|
2018-11-29 11:54:23 -08:00
|
|
|
# `set -x` causes these variables to be mangled.
|
|
|
|
# See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html
|
|
|
|
set +x
|
2018-11-04 13:24:46 -08:00
|
|
|
echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL"
|
|
|
|
echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM"
|
|
|
|
echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE"
|
|
|
|
fi
|