1
1
mirror of https://github.com/tweag/nickel.git synced 2024-08-15 22:50:22 +03:00

Backport master/1.4.1 (#1781)

* Make base branch configurable in release script

Instead of hardcoding master as the base branch for a new release, put
it inside a shell variable than can be overriden (at least by modifying
the script) for patch releases, where it's more common to start off a
specific branch which isn't master (but the previous release + selected
bug fixes).

Additionally, add a missing phase before releasing to crates.io: get rid
of `lsp-harness` dependencies in the LSP.

* [release.sh] update to 1.4.1

* Update scripts/release.sh
This commit is contained in:
Yann Hamdaoui 2024-01-28 09:51:48 +00:00 committed by GitHub
parent 220733cfa6
commit a16833ba52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 385 additions and 398 deletions

747
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ members = [
resolver = "2"
[workspace.package]
version = "1.4.0"
version = "1.4.1"
authors = ["The Nickel Team <nickel-lang@protonmail.com>"]
license = "MIT"
edition = "2021"
@ -21,7 +21,7 @@ homepage = "https://nickel-lang.org"
readme = "README.md"
[workspace.dependencies]
nickel-lang-core = { version = "0.4.0", path = "./core", default-features = false }
nickel-lang-core = { version = "0.5.0", path = "./core", default-features = false }
nickel-lang-utils = { version = "0.1.0", path = "./utils" }
lsp-harness = { version = "0.1.0", path = "./lsp/lsp-harness" }

View File

@ -1,6 +1,6 @@
[package]
name = "nickel-lang-core"
version = "0.4.0"
version = "0.5.0"
description = "Programmable configuration files."
authors.workspace = true
edition.workspace = true

View File

@ -19,6 +19,13 @@
# In some cases it can be useful to leave the workspace in the state it was to
# finish the release manually. In that case, set this variable to false.
DO_CLEANUP=true
# Where to branch off the release. It's `master` most of the time, but for patch
# releases it's common to not release current master but just cherry pick a few
# commits on top of the previous release.
#
# Ideally that would be specified as an argument. For the time being, having a
# variable makes it at least a bit more flexible than harcoding master.
RELEASE_BASE_BRANCH="master"
# Perform clean up actions upon unexpected exit.
cleanup() {
@ -294,9 +301,9 @@ if [[ -n $(git status --untracked-files=no --porcelain) ]]; then
confirm_proceed "++ [WARNING] Working directory is not clean. The cleanup code of this script might revert some of your uncommited changes"
fi
git switch master > /dev/null
git switch "$RELEASE_BASE_BRANCH" > /dev/null
echo "++ Prepare release branch from 'master'"
echo "++ Prepare release branch from '$RELEASE_BASE_BRANCH'"
# Directories of subcrates following their own independent versioning
independent_crates=(core utils lsp/lsp-harness ./wasm-repl)
@ -333,7 +340,7 @@ if git rev-parse --verify --quiet "$release_branch" > /dev/null; then
else
git switch --create "$release_branch" > /dev/null
cleanup_actions+=("git branch -d $release_branch")
cleanup_actions+=("git switch master")
cleanup_actions+=('git switch '"$RELEASE_BASE_BRANCH")
report_progress "Bumping workspace version number..."
@ -462,6 +469,18 @@ for crate in "${crates_to_publish[@]}"; do
cleanup_actions+=('git restore '"$crate/Cargo.toml")
done
report_progress "Removing 'lsp-harness' from dev-dependencies..."
for crate in "${crates_to_publish[@]}"; do
# Remove `lsp-harness` from `dev-dependencies` of released crates.
# `lsp-harness` is only used for testing the LSP and isn't published on
# crates.io, so we cut it off as well
#
# see [^tomlq-sed]
sed -i '/^lsp-harness\.workspace\s*=\s*true$/d' "$crate/Cargo.toml"
cleanup_actions+=('git restore '"$crate/Cargo.toml")
done
report_progress "Remove the format feature and topiary dependencies..."
for crate in "${crates_to_publish[@]}"; do
@ -518,8 +537,7 @@ cargo publish -p nickel-lang-lsp
report_progress "'nickel-lang-lsp' published successfully"
report_progress "Cleaning up..."
# Undo the previous commit removing `nickel-lang-utils` and other stuff from
# dependencies prior to publication
# Undo the previous commit massaging dependencies, and restore Cargo.lock.
git reset --hard HEAD~
cleanup_actions=()

View File

@ -1,6 +1,6 @@
[package]
name = "nickel-wasm-repl"
version = "0.4.0"
version = "0.5.0"
description = "WebAssembly REPL for the Nickel programming language."
authors.workspace = true
edition.workspace = true