]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/upload-artifacts.sh
Rollup merge of #92366 - jhpratt:derive-default-enum, r=Mark-Simulacrum
[rust.git] / src / ci / scripts / upload-artifacts.sh
1 #!/bin/bash
2 # Upload all the artifacts to our S3 bucket. All the files inside ${upload_dir}
3 # will be uploaded to the deploy bucket and eventually signed and released in
4 # static.rust-lang.org.
5
6 set -euo pipefail
7 IFS=$'\n\t'
8
9 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10
11 upload_dir="$(mktemp -d)"
12
13 # Release tarballs produced by a dist builder.
14 if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
15     dist_dir=build/dist
16     if isLinux; then
17         dist_dir=obj/build/dist
18     fi
19     rm -rf "${dist_dir}/doc"
20     cp -r "${dist_dir}"/* "${upload_dir}"
21 fi
22
23 # CPU usage statistics.
24 cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv"
25
26 # Toolstate data.
27 if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then
28     cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}"
29 fi
30
31 echo "Files that will be uploaded:"
32 ls -lah "${upload_dir}"
33 echo
34
35 deploy_dir="rustc-builds"
36 if [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then
37     deploy_dir="rustc-builds-alt"
38 fi
39 deploy_url="s3://${DEPLOY_BUCKET}/${deploy_dir}/$(ciCommit)"
40
41 retry aws s3 cp --no-progress --recursive --acl public-read "${upload_dir}" "${deploy_url}"