]> git.lizzy.rs Git - rust.git/blob - doc/release.md
Auto merge of #5671 - ebroto:changelog_144_145, r=flip1995
[rust.git] / doc / release.md
1 # Release a new Clippy Version
2
3 _NOTE: This document is probably only relevant to you, if you're a member of the
4 Clippy team._
5
6 Clippy is released together with stable Rust releases. The dates for these
7 releases can be found at the [Rust Forge]. This document explains the necessary
8 steps to create a Clippy release.
9
10 1. [Remerge the `beta` branch](#remerge-the-beta-branch)
11 2. [Update the `beta` branch](#update-the-beta-branch)
12 3. [Find the Clippy commit](#find-the-clippy-commit)
13 4. [Tag the stable commit](#tag-the-stable-commit)
14 5. [Update `CHANGELOG.md`](#update-changelogmd)
15
16 _NOTE: This document is for stable Rust releases, not for point releases. For
17 point releases, step 1. and 2. should be enough._
18
19 [Rust Forge]: https://forge.rust-lang.org/
20
21
22 ## Remerge the `beta` branch
23
24 This step is only necessary, if since the last release something was backported
25 to the beta Rust release. The remerge is then necessary, to make sure that the
26 Clippy commit, that was used by the now stable Rust release, persists in the
27 tree of the Clippy repository.
28
29 To find out if this step is necessary run
30
31 ```bash
32 # Assumes that the local master branch is up-to-date
33 $ git fetch upstream
34 $ git branch master --contains upstream/beta
35 ```
36
37 If this command outputs `master`, this step is **not** necessary.
38
39 ```bash
40 # Assuming `HEAD` is the current `master` branch of rust-lang/rust-clippy
41 $ git checkout -b backport_remerge
42 $ git merge upstream/beta
43 $ git diff  # This diff has to be empty, otherwise something with the remerge failed
44 $ git push origin backport_remerge  # This can be pushed to your fork
45 ```
46
47 After this, open a PR to the master branch. In this PR, the commit hash of the
48 `HEAD` of the `beta` branch must exists. In addition to that, no files should
49 be changed by this PR.
50
51
52 ## Update the `beta` branch
53
54 This step must be done **after** the PR of the previous step was merged.
55
56 First, the Clippy commit of the `beta` branch of the Rust repository has to be
57 determined.
58
59 ```bash
60 # Assuming the current directory corresponds to the Rust repository
61 $ git checkout beta
62 $ git submodule update
63 $ BETA_SHA=$(git submodule status src/tools/clippy | awk '{print $1}')
64 ```
65
66 After finding the Clippy commit, the `beta` branch in the Clippy repository can
67 be updated.
68
69 ```bash
70 # Assuming the current directory corresponds to the Clippy repository
71 $ git checkout beta
72 $ git rebase $BETA_SHA
73 $ git push upstream beta
74 ```
75
76
77 ## Find the Clippy commit
78
79 The first step is to tag the Clippy commit, that is included in the stable Rust
80 release. This commit can be found in the Rust repository.
81
82 ```bash
83 # Assuming the current directory corresponds to the Rust repository
84 $ git fetch upstream    # `upstream` is the `rust-lang/rust` remote
85 $ git checkout 1.XX.0   # XX should be exchanged with the corresponding version
86 $ git submodule update
87 $ SHA=$(git submodule status src/tools/clippy | awk '{print $1}')
88 ```
89
90
91 ## Tag the stable commit
92
93 After finding the Clippy commit, it can be tagged with the release number.
94
95 ```bash
96 # Assuming the current directory corresponds to the Clippy repository
97 $ git checkout $SHA
98 $ git tag rust-1.XX.0               # XX should be exchanged with the corresponding version
99 $ git push upstream master --tags   # `upstream` is the `rust-lang/rust-clippy` remote
100 ```
101
102 After this, the release should be available on the Clippy [release page].
103
104 [release page]: https://github.com/rust-lang/rust-clippy/releases
105
106
107 ## Update `CHANGELOG.md`
108
109 For this see the document on [how to update the changelog].
110
111 [how to update the changelog]: https://github.com/rust-lang/rust-clippy/blob/master/doc/changelog_update.md