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