Skip to content

Commit 2b472f6

Browse files
committed
Auto merge of #12915 - lnicola:promote-subtree, r=lnicola
internal: Update `xtask promote` and release instructions Update `xtask` for the subtree workflow. This doesn't explain how to do a `rust -> RA` sync, since that's definitely more involved, but will probably only happen rarely.
2 parents af64662 + 58c3a56 commit 2b472f6

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

docs/dev/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ Release process is handled by `release`, `dist` and `promote` xtasks, `release`
210210
./rust-rust-analyzer # Note the name!
211211
```
212212

213-
Additionally, it assumes that the remote for `rust-analyzer` is called `upstream` (I use `origin` to point to my fork).
213+
The remote for `rust-analyzer` must be called `upstream` (I use `origin` to point to my fork).
214+
In addition, for `xtask promote` (see below), `rust-rust-analyzer` must have a `rust-analyzer` remote pointing to this repository on GitHub.
214215

215216
`release` calls the GitHub API calls to scrape pull request comments and categorize them in the changelog.
216217
This step uses the `curl` and `jq` applications, which need to be available in `PATH`.
@@ -225,13 +226,13 @@ Release steps:
225226
* push it to `upstream`. This triggers GitHub Actions which:
226227
* runs `cargo xtask dist` to package binaries and VS Code extension
227228
* makes a GitHub release
228-
* pushes VS Code extension to the marketplace
229+
* publishes the VS Code extension to the marketplace
229230
* call the GitHub API for PR details
230231
* create a new changelog in `rust-analyzer.github.io`
231232
3. While the release is in progress, fill in the changelog
232233
4. Commit & push the changelog
233234
5. Tweet
234-
6. Inside `rust-analyzer`, run `cargo xtask promote` -- this will create a PR to rust-lang/rust updating rust-analyzer's submodule.
235+
6. Inside `rust-analyzer`, run `cargo xtask promote` -- this will create a PR to rust-lang/rust updating rust-analyzer's subtree.
235236
Self-approve the PR.
236237

237238
If the GitHub Actions release fails because of a transient problem like a timeout, you can re-run the job from the Actions console.

xtask/src/release.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,12 @@ impl flags::Promote {
7777
cmd!(sh, "git switch master").run()?;
7878
cmd!(sh, "git fetch upstream").run()?;
7979
cmd!(sh, "git reset --hard upstream/master").run()?;
80-
cmd!(sh, "git submodule update --recursive").run()?;
8180

8281
let date = date_iso(sh)?;
8382
let branch = format!("rust-analyzer-{date}");
8483
cmd!(sh, "git switch -c {branch}").run()?;
85-
{
86-
let _dir = sh.push_dir("src/tools/rust-analyzer");
87-
cmd!(sh, "git fetch origin").run()?;
88-
cmd!(sh, "git reset --hard origin/release").run()?;
89-
}
90-
cmd!(sh, "git add src/tools/rust-analyzer").run()?;
91-
cmd!(sh, "git commit -m':arrow_up: rust-analyzer'").run()?;
84+
cmd!(sh, "git subtree pull -P src/tools/rust-analyzer rust-analyzer master").run()?;
85+
9286
if !self.dry_run {
9387
cmd!(sh, "git push -u origin {branch}").run()?;
9488
cmd!(

0 commit comments

Comments
 (0)