Skip to content

Commit

Permalink
chore: autonomi rebranding
Browse files Browse the repository at this point in the history
This brings `safeup` in alignment with the rebranding of Safe Network to Autonomi.

BREAKING CHANGE:
* The crate name is changed from `safeup` -> `antup`.
* The binary name is changed from `safeup` -> `antup`.
* The new `ant-releases` repository is referenced and the `sn-releases` reference is removed.
* The settings file has its properties renamed.
  • Loading branch information
jacderida committed Dec 14, 2024
1 parent 04f8474 commit 27201a4
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 307 deletions.
100 changes: 50 additions & 50 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on: pull_request
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
CLIENT_VERSION: 0.1.2
NODE_VERSION: 0.112.1
NODE_MANAGER_VERSION: 0.11.0
CLIENT_VERSION: 0.3.0-rc.1
NODE_VERSION: 0.3.0-rc.1
ANTCTL_VERSION: 0.11.4-rc.1

jobs:
# The code in this crate uses lots of conditional compilation for cross-platform capabilities.
Expand Down Expand Up @@ -142,29 +142,29 @@ jobs:
run: |
cargo run -- client --version $env:CLIENT_VERSION
cargo run -- node --version $env:NODE_VERSION
cargo run -- node-manager --version $env:NODE_MANAGER_VERSION
cargo run -- antctl --version $env:ANTCTL_VERSION
- name: Check if binaries are available in new shell session
shell: pwsh
run: |
if (!(Test-Path "$env:USERPROFILE\autonomi\autonomi.exe")) {
Write-Host "autonomi.exe does not exist"
if (!(Test-Path "$env:USERPROFILE\autonomi\ant.exe")) {
Write-Host "ant.exe does not exist"
exit 1
}
if (!(Test-Path "$env:USERPROFILE\autonomi\safenode.exe")) {
Write-Host "safenode.exe does not exist"
if (!(Test-Path "$env:USERPROFILE\autonomi\antnode.exe")) {
Write-Host "antnode.exe does not exist"
exit 1
}
if (!(Test-Path "$env:USERPROFILE\autonomi\safenode-manager.exe")) {
Write-Host "safenode-manager.exe does not exist"
if (!(Test-Path "$env:USERPROFILE\autonomi\antctl.exe")) {
Write-Host "antctl.exe does not exist"
exit 1
}
# For security reasons, the GHA infrastructure prevents environment variables
# being modified easily, so we need to refer to the binaries with their full paths.
# Other manual testing has proven that the changes to the Path environment variable do
# take effect.
$output = & "${env:USERPROFILE}\autonomi\autonomi.exe" --version
$version = $output | Select-String -Pattern "autonomi-cli (\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[0-9]+)?)?)"
$output = & "${env:USERPROFILE}\autonomi\ant.exe" --version
$version = $output | Select-String -Pattern "ant-cli (\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[0-9]+)?)?)"
$versionNumber = $version.Matches.Groups[1].Value
if ($versionNumber -eq "$env:CLIENT_VERSION") {
Write-Host "The correct version of autonomi has been installed"
Expand All @@ -175,26 +175,26 @@ jobs:
exit 1
}
$output = & "${env:USERPROFILE}\autonomi\safenode.exe" --version
$output = & "${env:USERPROFILE}\autonomi\antnode.exe" --version
$version = $output -split "`n" | Select-Object -First 1
$versionNumber = ($version -split "v")[1].Trim()
if ($versionNumber -eq "$env:NODE_VERSION") {
Write-Host "The correct version of safenode has been installed"
Write-Host "The correct version of antnode has been installed"
} else {
Write-Host "The correct version of safenode has not been installed"
Write-Host "The correct version of antnode has not been installed"
Write-Host "We expected version $env:NODE_VERSION"
Write-Host "The downloaded binary has $versionNumber"
exit 1
}
$output = & "${env:USERPROFILE}\autonomi\safenode-manager.exe" --version
$output = & "${env:USERPROFILE}\autonomi\antctl.exe" --version
$version = $output -split "`n" | Select-Object -First 1
$versionNumber = ($version -split "v")[1].Trim()
if ($versionNumber -eq "$env:NODE_MANAGER_VERSION") {
Write-Host "The correct version of safenode-manager has been installed"
if ($versionNumber -eq "$env:ANTCTL_VERSION") {
Write-Host "The correct version of antctl has been installed"
} else {
Write-Host "The correct version of safenode-manager has not been installed"
Write-Host "We expected version $env:NODE_MANAGER_VERSION"
Write-Host "The correct version of antctl has not been installed"
Write-Host "We expected version $env:ANTCTL_VERSION"
Write-Host "The downloaded binary has $versionNumber"
exit 1
}
Expand All @@ -215,7 +215,7 @@ jobs:
run: |
cargo run -- client --version $CLIENT_VERSION
cargo run -- node --version $NODE_VERSION
cargo run -- node-manager --version $NODE_MANAGER_VERSION
cargo run -- antctl --version $ANTCTL_VERSION
- name: Check if binaries are available in new shell session
shell: bash
run: |
Expand All @@ -228,36 +228,36 @@ jobs:
# locations.
source ~/.config/autonomi/env
[[ -f "$HOME/.local/bin/autonomi" ]] || { echo "autonomi not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/safenode" ]] || { echo "safenode not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/safenode-manager" ]] || { echo "safenode-manager not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/ant" ]] || { echo "ant not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/antnode" ]] || { echo "antnode not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/antctl" ]] || { echo "antctl not in expected location"; exit 1; }
version=$(autonomi --version | awk '{ print $2 }')
version=$(ant --version | awk '{ print $2 }')
if [[ "$version" == "$CLIENT_VERSION" ]]; then
echo "The correct version of autonomi has been installed"
echo "The correct version of ant has been installed"
else
echo "The correct version of autonomi has not been installed"
echo "The correct version of ant has not been installed"
echo "We expected $CLIENT_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
version=$(safenode --version | head -n 1 | awk '{print $3}' | sed 's/^v//')
version=$(antnode --version | head -n 1 | awk '{print $3}' | sed 's/^v//')
if [[ "$version" == "$NODE_VERSION" ]]; then
echo "The correct version of safenode has been installed"
echo "The correct version of antnode has been installed"
else
echo "The correct version of safenode has not been installed"
echo "The correct version of antnode has not been installed"
echo "We expected $NODE_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
version=$(safenode-manager --version | head -n 1 | awk '{print $4}' | sed 's/^v//')
if [[ "$version" == "$NODE_MANAGER_VERSION" ]]; then
echo "The correct version of safenode-manager has been installed"
version=$(antctl --version | head -n 1 | awk '{print $4}' | sed 's/^v//')
if [[ "$version" == "$ANTCTL_VERSION" ]]; then
echo "The correct version of antctl has been installed"
else
echo "The correct version of safenode-manager has not been installed"
echo "We expected $NODE_MANAGER_VERSION"
echo "The correct version of antctl has not been installed"
echo "We expected $ANTCTL_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
Expand All @@ -277,42 +277,42 @@ jobs:
run: |
cargo run -- client --version $CLIENT_VERSION
cargo run -- node --version $NODE_VERSION
cargo run -- node-manager --version $NODE_MANAGER_VERSION
cargo run -- antctl --version $ANTCTL_VERSION
- name: Check if binaries are available in new shell session
run: |
# As with the Ubuntu test, we need to source the env file to get the binaries on PATH.
source "/Users/runner/Library/Application Support/autonomi/env"
[[ -f "$HOME/.local/bin/autonomi" ]] || { echo "autonomi not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/safenode" ]] || { echo "safenode not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/safenode-manager" ]] || { echo "safenode-manager not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/ant" ]] || { echo "ant not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/antnode" ]] || { echo "antnode not in expected location"; exit 1; }
[[ -f "$HOME/.local/bin/antctl" ]] || { echo "antctl not in expected location"; exit 1; }
version=$(autonomi --version | awk '{ print $2 }')
version=$(ant --version | awk '{ print $2 }')
if [[ "$version" == "$CLIENT_VERSION" ]]; then
echo "The correct version of autonomi has been installed"
echo "The correct version of ant has been installed"
else
echo "The correct version of autonomi has not been installed"
echo "The correct version of ant has not been installed"
echo "We expected $CLIENT_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
version=$(safenode --version | head -n 1 | awk '{print $3}' | sed 's/^v//')
version=$(antnode --version | head -n 1 | awk '{print $3}' | sed 's/^v//')
if [[ "$version" == "$NODE_VERSION" ]]; then
echo "The correct version of safenode has been installed"
echo "The correct version of antnode has been installed"
else
echo "The correct version of safenode has not been installed"
echo "The correct version of antnode has not been installed"
echo "We expected $NODE_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
version=$(safenode-manager --version | head -n 1 | awk '{print $4}' | sed 's/^v//')
if [[ "$version" == "$NODE_MANAGER_VERSION" ]]; then
echo "The correct version of safenode-manager has been installed"
version=$(antctl --version | head -n 1 | awk '{print $4}' | sed 's/^v//')
if [[ "$version" == "$ANTCTL_VERSION" ]]; then
echo "The correct version of antctl has been installed"
else
echo "The correct version of safenode-manager has not been installed"
echo "We expected $NODE_MANAGER_VERSION"
echo "The correct version of antctl has not been installed"
echo "We expected $ANTCTL_VERSION"
echo "The downloaded binary has $version"
exit 1
fi
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "safeup"
name = "antup"
authors = ["MaidSafe Developers <dev@maidsafe.net>"]
description = "CLI for installing components for accessing the Safe Network"
description = "CLI for installing components for accessing the Autonomi network"
license = "GPL-3.0"
version = "0.8.1"
edition = "2021"

[[bin]]
name = "safeup"
name = "antup"
path = "src/main.rs"

[dependencies]
ant-releases = "0.4.0"
clap = { version = "4.1.6", features = ["derive"] }
chrono = "0.4.26"
color-eyre = "0.6.2"
Expand All @@ -24,7 +25,6 @@ semver = "1.0.4"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
sn-releases = "0.3.1"
tempfile = "3.8.1"
textwrap = "0.16.0"
tokio = { version = "1.26", features = ["full"] }
Expand All @@ -37,4 +37,4 @@ assert_fs = "~1.0"
assert_matches = "1.5.0"
async-trait = "0.1"
mockall = "0.11.3"
predicates = "2.0"
predicates = "2.0"
14 changes: 7 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env just --justfile

release_repo := "maidsafe/safeup"
release_repo := "maidsafe/antup"

build-release-artifacts arch:
#!/usr/bin/env bash
Expand Down Expand Up @@ -48,9 +48,9 @@ build-release-artifacts arch:
cargo clean
if [[ $arch == arm* || $arch == armv7* || $arch == aarch64* ]]; then
cargo install cross
cross build --release --target $arch --bin safeup
cross build --release --target $arch --bin antup
else
cargo build --release --target $arch --bin safeup
cargo build --release --target $arch --bin antup
fi

find target/$arch/release -maxdepth 1 -type f -exec cp '{}' artifacts \;
Expand All @@ -69,7 +69,7 @@ package-release-assets:
"armv7-unknown-linux-musleabihf"
"aarch64-unknown-linux-musl"
)
bin="safeup"
bin="antup"
version=$(cat Cargo.toml | grep "^version" | awk -F '=' '{ print $2 }' | xargs)

rm -rf deploy/$bin
Expand All @@ -90,14 +90,14 @@ upload-release-assets:
set -e
version=$(cat Cargo.toml | grep "^version" | awk -F '=' '{ print $2 }' | xargs)
echo "Uploading assets to release..."
cd deploy/safeup
cd deploy/antup
ls | xargs gh release upload "v${version}" --repo {{release_repo}}
upload-release-assets-to-s3:
#!/usr/bin/env bash
set -e
cd deploy/safeup
cd deploy/antup
for file in *.zip *.tar.gz; do
aws s3 cp "$file" "s3://sn-safeup/$file" --acl public-read
aws s3 cp "$file" "s3://antup/$file" --acl public-read
done
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# safeup
# antup

Simple utility for installing and updating safe-related components.

## Install

### Linux/macOS

You can choose to run the installation for `safeup` as the current user or with `sudo`. The difference between them is the install location and modification of the shell profile. If running with `sudo`, `safeup` will be installed to `/usr/local/bin`; otherwise it will be installed to `~/.local/bin` and the Bash shell profile will be modified to add that location to the `PATH` variable. For almost any Linux-based or macOS installation, `/usr/local/bin` is already available on `PATH` as standard.
You can choose to run the installation for `antup` as the current user or with `sudo`. The difference between them is the install location and modification of the shell profile. If running with `sudo`, `antup` will be installed to `/usr/local/bin`; otherwise it will be installed to `~/.local/bin` and the Bash shell profile will be modified to add that location to the `PATH` variable. For almost any Linux-based or macOS installation, `/usr/local/bin` is already available on `PATH` as standard.

To install as `sudo`, use the following:
```
curl -sSL https://raw.githubusercontent.com/maidsafe/safeup/main/install.sh | sudo bash
curl -sSL https://raw.githubusercontent.com/maidsafe/antup/main/install.sh | sudo bash
```

Otherwise:
```
curl -sSL https://raw.githubusercontent.com/maidsafe/safeup/main/install.sh | bash
curl -sSL https://raw.githubusercontent.com/maidsafe/antup/main/install.sh | bash
```

This process will download and install `safeup` for your platform.
This process will download and install `antup` for your platform.

The install script also accepts two flag arguments, namely `--client` and `--node`. If either are used, the script will invoke the installed `safeup` binary to install `autonomi` and `safenode`, respectively, without having to run either as an additional post-install step.
The install script also accepts two flag arguments, namely `--client` and `--node`. If either are used, the script will invoke the installed `antup` binary to install `autonomi` and `safenode`, respectively, without having to run either as an additional post-install step.

To use these options as `sudo`:
```
curl -sSL https://raw.githubusercontent.com/maidsafe/safeup/main/install.sh | sudo bash -s -- --client
curl -sSL https://raw.githubusercontent.com/maidsafe/antup/main/install.sh | sudo bash -s -- --client
```

Otherwise:
```
curl -sSL https://raw.githubusercontent.com/maidsafe/safeup/main/install.sh | bash -s -- --client
curl -sSL https://raw.githubusercontent.com/maidsafe/antup/main/install.sh | bash -s -- --client
```

### Windows

On Windows, we are currently not supporting installing either `safeup` or the other binaries with Administrator privileges, so there is only one command:
On Windows, we are currently not supporting installing either `antup` or the other binaries with Administrator privileges, so there is only one command:
```
iex (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/maidsafe/safeup/main/install.ps1")
iex (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/maidsafe/antup/main/install.ps1")
```

The Powershell installer does not support the `--client` or `--node` arguments because it's not possible to pass them when the script is downloaded.

Therefore, installing any components on Windows is an additional post-safeup-installation step.
Therefore, installing any components on Windows is an additional post-installation step.

## Usage

Use the `client`, `node` or `testnet` commands to install the latest versions of the `autonomi`, `safenode` or `testnet` binaries, respectively.
Use the `client`, `node` or `antctl` commands to install the latest versions of the `ant`, `antnode` or `antctl` binaries, respectively.

As above, you can choose to run `safeup` using `sudo`, depending on where you'd like your binaries installed. Again, this does not apply to Windows, where we don't support running with Administrator privileges.
As above, you can choose to run `antup` using `sudo`, depending on where you'd like your binaries installed. Again, this does not apply to Windows, where we don't support running with Administrator privileges.

## License

Expand Down
Loading

0 comments on commit 27201a4

Please sign in to comment.