From d205273f44f66e36725e1295b8d9189704b2beb3 Mon Sep 17 00:00:00 2001 From: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com> Date: Mon, 13 Nov 2023 18:28:13 +0100 Subject: [PATCH] docs: document Gitea releases (#1076) --- crates/release_plz/tests/all/changelog.rs | 2 +- crates/release_plz_core/src/next_ver.rs | 2 +- crates/release_plz_core/src/repo_url.rs | 4 ++-- website/docs/usage/release.md | 8 +++++++- website/docs/usage/shell-completion.md | 2 +- website/docs/usage/update.md | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/crates/release_plz/tests/all/changelog.rs b/crates/release_plz/tests/all/changelog.rs index 361d513d3d..3c655c45f1 100644 --- a/crates/release_plz/tests/all/changelog.rs +++ b/crates/release_plz/tests/all/changelog.rs @@ -14,7 +14,7 @@ async fn release_plz_adds_changelog_on_new_project() { .gitea .changed_files_in_pr(opened_prs[0].number) .await; - assert_eq!(changed_files.len(), 1,); + assert_eq!(changed_files.len(), 1); assert_eq!(changed_files[0].filename, "CHANGELOG.md"); } diff --git a/crates/release_plz_core/src/next_ver.rs b/crates/release_plz_core/src/next_ver.rs index 0e840ba8d6..29bbc7f01b 100644 --- a/crates/release_plz_core/src/next_ver.rs +++ b/crates/release_plz_core/src/next_ver.rs @@ -937,7 +937,7 @@ fn is_library(package: &Package) -> bool { pub fn copy_to_temp_dir(target: &Path) -> anyhow::Result { let tmp_dir = tempdir().context("cannot create temporary directory")?; copy_dir(target, tmp_dir.as_ref()) - .with_context(|| format!("cannot copy directory {target:?} to {tmp_dir:?}",))?; + .with_context(|| format!("cannot copy directory {target:?} to {tmp_dir:?}"))?; Ok(tmp_dir) } diff --git a/crates/release_plz_core/src/repo_url.rs b/crates/release_plz_core/src/repo_url.rs index faa32c9fcb..ba34c8ee31 100644 --- a/crates/release_plz_core/src/repo_url.rs +++ b/crates/release_plz_core/src/repo_url.rs @@ -51,14 +51,14 @@ impl RepoUrl { if prev_tag == new_tag { format!("{host}/releases/tag/{new_tag}") } else { - format!("{host}/compare/{prev_tag}...{new_tag}",) + format!("{host}/compare/{prev_tag}...{new_tag}") } } pub fn git_pr_link(&self) -> String { let host = format!("https://{}/{}/{}", self.host, self.owner, self.name); let pull_path = if self.is_on_github() { "pull" } else { "pulls" }; - format!("{host}/{pull_path}",) + format!("{host}/{pull_path}") } pub fn gitea_api_url(&self) -> String { diff --git a/website/docs/usage/release.md b/website/docs/usage/release.md index 4f6f86cf4a..28c6b66038 100644 --- a/website/docs/usage/release.md +++ b/website/docs/usage/release.md @@ -12,7 +12,7 @@ For every release, release-plz: - Creates a git tag named `-v` (e.g. `tokio-v1.8.1`). - Publishes the package to the cargo registry by running `cargo publish`. -- Publishes a GitHub/Gitea release based on the git tag. +- Publishes a GitHub/Gitea/GitLab release based on the git tag. In the tag name, `-` is omitted if there's only one package to publish (i.e. with `publish != false` in the `Cargo.toml` file). @@ -41,3 +41,9 @@ The permissions you need are: Then you can run `release-plz release` in Gitlab CI with the following arguments: `release-plz release --backend gitlab --git-token ` + +## Gitea + +`releases-plz` also supports creating releases on Gitea with the `--backend gitea` option. + +TODO: document how to create a token on Gitea. diff --git a/website/docs/usage/shell-completion.md b/website/docs/usage/shell-completion.md index 0f3f56cef3..836cc585bb 100644 --- a/website/docs/usage/shell-completion.md +++ b/website/docs/usage/shell-completion.md @@ -1,4 +1,4 @@ -# Shell completion +# shell-completion In the following, you can find instructions on how to generate release-plz command completions for each shell. diff --git a/website/docs/usage/update.md b/website/docs/usage/update.md index fb63b10c0e..012d6af909 100644 --- a/website/docs/usage/update.md +++ b/website/docs/usage/update.md @@ -1,7 +1,7 @@ -# Update +# update The `release-plz update` command updates the version and the changelog of the -packages of a local workspace. +packages containing unreleased changes. The command: