Skip to content

Commit

Permalink
Merge branch 'tomas/split-release' (#4117)
Browse files Browse the repository at this point in the history
* tomas/split-release:
  changelog: add #4117
  exclude apps crate from libs release
  apps: don't use workspace version anymore
  add a script to release apps bins
  prefix libs release tag with "libs-"
  mv scripts/release.sh scripts/release_libs.sh
  add different commit msg for libs release
  add a different release config for apps
  • Loading branch information
tzemanovic committed Nov 29, 2024
2 parents 1362f34 + 63dae40 commit 6f0e3b0
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changelog/unreleased/miscellaneous/4117-split-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Starting from the next release the Namada binary apps (`namada`, `namadan`,
`namadac` and `namadaw`) will be versioned separately from the libaries
(everything else including the wasm). The libraries releases will have their
tag prefixed with "lib-" and will continue with the current versioning scheme.
([\#4117](https://github.com/anoma/namada/pull/4117))
2 changes: 1 addition & 1 deletion crates/apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
version.workspace = true
version = "0.46.0"

# Namada CLI that aggregates some common commands for the node and the client
[[bin]]
Expand Down
7 changes: 7 additions & 0 deletions crates/apps/release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allow-branch = ["main", "maint-*"]
consolidate-commits = true
pre-release-commit-message = "Namada {{version}}"
publish = false
push = false
shared-version = false
tag = false
2 changes: 1 addition & 1 deletion release.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allow-branch = ["main", "maint-*"]
consolidate-commits = true
pre-release-commit-message = "Namada {{version}}"
pre-release-commit-message = "Namada libs {{version}}"
publish = false
push = false
shared-version = true
Expand Down
41 changes: 41 additions & 0 deletions scripts/release_bins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh
# depends on cargo-release 0.24.4, git 2.24.0 or later, unclog 0.5.0
set -e

if [ -z "$1" ]; then
echo "please specify a version to release"
exit 1
fi

REPO_ROOT=$(git rev-parse --show-toplevel)

if [ "$REPO_ROOT" != "$PWD" ]; then
echo "please run from repository root"
exit 1
fi

VERSION="$1"
TAG_NAME="v$1"

# start from a clean build
git clean -fxd

# update the apps crate versions (1 commit)
HASH_BEFORE=$(git rev-parse HEAD)
cd $REPO_ROOT/crates/apps
cargo release version --execute $VERSION
git commit -am "Namada $VERSION"
HASH_AFTER=$(git rev-parse HEAD)

# update the changelog (1 fixup)
cd $REPO_ROOT
unclog release $TAG_NAME
unclog build > CHANGELOG.md
git add .changelog CHANGELOG.md
git commit --fixup=$HASH_AFTER

# show the user the result
git rebase --interactive --autosquash --keep-base $HASH_BEFORE

echo "final $TAG_NAME commit ready for testing"

6 changes: 3 additions & 3 deletions scripts/release.sh → scripts/release_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ if [ "$REPO_ROOT" != "$PWD" ]; then
fi

VERSION="$1"
TAG_NAME="v$1"
TAG_NAME="libs-v$1" # prefixed to distinguish from bins release

# start from a clean build
git clean -fxd

# update the main workspace crate versions (1 commit)
HASH_BEFORE=$(git rev-parse HEAD)
cargo release version --execute $VERSION
git commit -am "Namada $VERSION"
cargo release version --exclude namada_apps --execute $VERSION
git commit -am "Namada libs $VERSION"
HASH_AFTER=$(git rev-parse HEAD)

# update the wasm workspace crate versions (1 fixup)
Expand Down
2 changes: 1 addition & 1 deletion wasm/release.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allow-branch = ["main", "maint-*"]
consolidate-commits = true
pre-release-commit-message = "fixup! Namada {{version}}"
pre-release-commit-message = "fixup! Namada libs {{version}}"
publish = false
push = false
shared-version = true
Expand Down
2 changes: 1 addition & 1 deletion wasm_for_tests/release.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allow-branch = ["main", "maint-*"]
consolidate-commits = true
pre-release-commit-message = "fixup! Namada {{version}}"
pre-release-commit-message = "fixup! Namada libs {{version}}"
publish = false
push = false
shared-version = true
Expand Down

0 comments on commit 6f0e3b0

Please sign in to comment.