2018-11-04 13:24:46 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ "${BUILD_REASON}" != "PullRequest" ]; then
|
|
|
|
cd "$ZIGBUILDDIR"
|
|
|
|
|
2018-11-05 13:55:16 -08:00
|
|
|
rm release/*.lib
|
2018-11-04 13:24:46 -08:00
|
|
|
mv ../LICENSE release/
|
|
|
|
mv ../zig-cache/langref.html release/
|
|
|
|
mv release/bin/zig.exe release/
|
|
|
|
rmdir release/bin
|
|
|
|
|
|
|
|
VERSION=$(release/zig.exe version)
|
|
|
|
DIRNAME="zig-windows-x86_64-$VERSION"
|
|
|
|
TARBALL="$DIRNAME.zip"
|
|
|
|
mv release "$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"
|
|
|
|
s3cmd put -P "$TARBALL" s3://ziglang.org/builds/
|
|
|
|
touch empty
|
|
|
|
s3cmd put -P empty s3://ziglang.org/builds/zig-windows-x86_64-$BUILD_SOURCEBRANCHNAME.tar.xz --add-header="Cache-Control: max-age=0, must-revalidate" --add-header="x-amz-website-redirect-location:/builds/$TARBALL"
|
|
|
|
|
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)
|
|
|
|
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
|