mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-09-11 13:45:56 +03:00
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:
parent
ee64875861
commit
bbbf8afb08
@ -1,7 +1,19 @@
|
||||
cd crates
|
||||
use std log
|
||||
|
||||
def publish [
|
||||
crate: path # the path to the crate to publish.
|
||||
--no-verify: bool # don’t 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
|
||||
|
Loading…
Reference in New Issue
Block a user