]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/.github/deploy.sh
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / .github / deploy.sh
CommitLineData
f20569fa
XL
1#!/bin/bash
2
3set -ex
4
5echo "Removing the current docs for master"
6rm -rf out/master/ || exit 0
7
8echo "Making the docs for master"
9mkdir out/master/
10cp util/gh-pages/index.html out/master
11python3 ./util/export.py out/master/lints.json
12
13if [[ -n $TAG_NAME ]]; then
14 echo "Save the doc for the current tag ($TAG_NAME) and point stable/ to it"
15 cp -r out/master "out/$TAG_NAME"
16 rm -f out/stable
17 ln -s "$TAG_NAME" out/stable
18fi
19
20if [[ $BETA = "true" ]]; then
21 echo "Update documentation for the beta release"
22 cp -r out/master/* out/beta
23fi
24
25# Generate version index that is shown as root index page
26cp util/gh-pages/versions.html out/index.html
27
28echo "Making the versions.json file"
29python3 ./util/versions.py out
30
31cd out
32# Now let's go have some fun with the cloned repo
33git config user.name "GHA CI"
34git config user.email "gha@ci.invalid"
35
36if [[ -n $TAG_NAME ]]; then
37 # track files, so that the following check works
38 git add --intent-to-add "$TAG_NAME"
39 if git diff --exit-code --quiet -- $TAG_NAME/; then
40 echo "No changes to the output on this push; exiting."
41 exit 0
42 fi
43 # Add the new dir
44 git add "$TAG_NAME"
45 # Update the symlink
46 git add stable
47 # Update versions file
48 git add versions.json
49 git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
50elif [[ $BETA = "true" ]]; then
51 if git diff --exit-code --quiet -- beta/; then
52 echo "No changes to the output on this push; exiting."
53 exit 0
54 fi
55 git add beta
56 git commit -m "Automatic deploy to GitHub Pages (beta): ${SHA}"
57else
58 if git diff --exit-code --quiet; then
59 echo "No changes to the output on this push; exiting."
60 exit 0
61 fi
62 git add .
63 git commit -m "Automatic deploy to GitHub Pages: ${SHA}"
64fi
65
66git push "$SSH_REPO" "$TARGET_BRANCH"