mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
21810c2aa1
Bug: https://github.com/dart-lang/sdk/issues/36047 Change-Id: Ibe599c00345ea7ed2007f3d16b4d417c9ee8d3f4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96540 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
61 lines
1.7 KiB
Bash
Executable file
61 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
# Uploads the following dill files to CIPD, indexed by the current ABI version:
|
|
# $build_dir/vm_platform_strong.dill
|
|
# $build_dir/gen/kernel_service.dill
|
|
# $build_dir/gen_kernel_bytecode.dill
|
|
# This script is a no-op unless $BUILDBOT_BUILDERNAME is "dart-sdk-linux-be".
|
|
# It's also a no-op if dill files were already uploaded today.
|
|
set -e
|
|
set -x
|
|
|
|
if [ -z "$2" ]; then
|
|
echo "Usage: upload_abi_dills.sh version_file build_dir"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$BUILDBOT_BUILDERNAME" != "dart-sdk-linux-be" ]; then
|
|
echo "This script only works on the dart-sdk-linux-be buildbot"
|
|
exit 0
|
|
fi
|
|
|
|
abi_version=$(sed -n "s/^ABI_VERSION \([0-9]*\)$/\1/p" "$1")
|
|
git_revision=$(git rev-parse HEAD)
|
|
current_date=$(date +%F)
|
|
search_results=$(cipd search \
|
|
"dart/abiversions/$abi_version" \
|
|
-tag "date:$current_date" | grep "Instances:" || echo "")
|
|
|
|
if [ ! -z "$search_results" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
sdk_dir=$(pwd)
|
|
tmpdir=$(mktemp -d)
|
|
chmod 755 $tmpdir
|
|
cleanup() {
|
|
rm -rf "$tmpdir"
|
|
}
|
|
trap cleanup EXIT HUP INT QUIT TERM PIPE
|
|
pushd "$tmpdir"
|
|
|
|
mkdir abiversions
|
|
cp "$sdk_dir/$2/vm_platform_strong.dill" "abiversions/vm_platform_strong.dill"
|
|
cp "$sdk_dir/$2/gen/kernel_service.dill" "abiversions/kernel_service.dill"
|
|
cp "$sdk_dir/$2/gen_kernel_bytecode.dill" "abiversions/gen_kernel_bytecode.dill"
|
|
|
|
cipd create \
|
|
-name dart/abiversions/$abi_version \
|
|
-in abiversions \
|
|
-install-mode copy \
|
|
-tag version:$abi_version \
|
|
-tag date:$current_date \
|
|
-tag git_revision:$git_revision \
|
|
-ref latest \
|
|
-ref version_$abi_version
|
|
|
|
popd
|