forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aptos-cli] Add build script for CLI release and bump CLI version
- Loading branch information
1 parent
4753489
commit a23c164
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "aptos" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
authors = ["Aptos Labs <[email protected]>"] | ||
description = "Aptos tool for management of nodes and interacting with the blockchain" | ||
repository = "https://github.com/aptos-labs/aptos-core" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# Copyright (c) Aptos | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
########################################### | ||
# Build and package a release for the CLI # | ||
# # | ||
########################################### | ||
|
||
# Note: This must be run from the root of the aptos-core repository | ||
NAME='aptos-cli' | ||
CRATE_NAME='aptos' | ||
CARGO_PATH="crates/$CRATE_NAME/Cargo.toml" | ||
|
||
# Grab system information | ||
ARCH=`uname -m` | ||
OS=`uname -s` | ||
VERSION=`cat "$CARGO_PATH" | grep "^\w*version =" | sed 's/^.*=[ ]*"//g' | sed 's/".*$//g'` | ||
|
||
if [ "$OS" == "Darwin" ]; then | ||
# Rename Darwin to MacOSX so it's less confusing | ||
OS="MacOSX" | ||
elif [ "$OS" == "Linux" ]; then | ||
# Get linux flavor | ||
OS=`cat /etc/os-release | grep '^NAME=' | sed 's/^.*=//g' | sed 's/"//g'` | ||
fi | ||
|
||
echo "Building release $VERSION of $NAME for $OS-$ARCH" | ||
cargo build -p $CRATE_NAME --release | ||
|
||
EXIT_CODE=$? | ||
if [ "$EXIT_CODE" != "0" ]; then | ||
echo "Build failed with exit code $EXIT_CODE" | ||
exit $EXIT_CODE | ||
fi | ||
|
||
cd target/release/ | ||
|
||
# Compress the CLI | ||
ZIP_NAME="$NAME-$VERSION-$OS-$ARCH.zip" | ||
|
||
echo "Zipping release: $ZIP_NAME" | ||
zip $ZIP_NAME $CRATE_NAME | ||
mv $ZIP_NAME ../.. | ||
|
||
# TODO: Add installation instructions? |