refactor: simplify the nu_release script (#540)

* remove useless comments

* use `--manifest-path` instead of `cd`ing

* add a bit of logging

* use an env-scoped `publish` command instead of `--manifest-path`

this will achieve the same result and make sure we control the
behaviour of the options, which we do not with unclear
`--manifest-path`.
This commit is contained in:
Antoine Stevan 2023-07-08 12:47:40 +02:00 committed by GitHub
parent ee64875861
commit bbbf8afb08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,19 @@
cd crates
use std log
def publish [
crate: path # the path to the crate to publish.
--no-verify: bool # dont verify the contents by building them. Can be useful for crates with a `build.rs`.
] {
cd $crate
if $no_verify {
cargo publish --no-verify
} else {
cargo publish
}
}
let subcrates_wave_1 = [
# components
nu-glob,
nu-json,
nu-path,
@ -31,38 +43,25 @@ let subcrates_wave_3 = [
nu-cli,
nu-std,
# plugins
nu_plugin_query,
nu_plugin_inc,
nu_plugin_gstat,
nu_plugin_formats,
]
# Recent versions of cargo verify the upload of your crate
# So no need to `sleep` anymore.
log warning "publishing the first wave of crates"
for subcrate in $subcrates_wave_1 {
cd $subcrate
cargo publish
# sleep 1min
cd ..
publish ("crates" | path join $subcrate)
}
log warning "publishing the second wave of crates"
for subcrate in $subcrates_wave_2 {
cd $subcrate
# due to build.rs in `nu-command`
cargo publish --no-verify
# sleep 1min
cd ..
publish ("crates" | path join $subcrate) --no-verify
}
log warning "publishing the third wave of crates"
for subcrate in $subcrates_wave_3 {
cd $subcrate
cargo publish
# sleep 1min
cd ..
publish ("crates" | path join $subcrate)
}
cd ..
cargo publish