Skip to content

Commit

Permalink
Derek/ora 1006 release allorad binaries (#81)
Browse files Browse the repository at this point in the history
needed to make some updates to the build script, and then added an
install script

---------

Signed-off-by: Derek Anderson <derek@upshot.xyz>
  • Loading branch information
dmikey authored Mar 20, 2024
1 parent c6064b3 commit 7560577
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
- name: Issue Release Assets
if: ${{ steps.vars.outputs.should_release == 'true' }}
run: |
GOOS=darwin GOARCH=arm64 go build -o release/darwin_arm64/allorad cmd/allorad/main.go
GOOS=darwin GOARCH=amd64 go build -o release/darwin_amd64/allorad cmd/allorad/main.go
GOOS=linux GOARCH=arm64 go build -o release/linux_arm64/allorad cmd/allorad/main.go
GOOS=linux GOARCH=amd64 go build -o release/linux_amd64/allorad cmd/allorad/main.go
GOOS=windows GOARCH=arm64 go build -o release/windows_arm64/allorad.exe cmd/allorad/main.go
GOOS=windows GOARCH=amd64 go build -o release/windows_amd64/allorad.exe cmd/allorad/main.go
GOOS=darwin GOARCH=arm64 go build -o release/allorad_darwin_arm64 cmd/allorad/main.go
GOOS=darwin GOARCH=amd64 go build -o release/allorad_darwin_amd64 cmd/allorad/main.go
GOOS=linux GOARCH=arm64 go build -o release/allorad_linux_arm64 cmd/allorad/main.go
GOOS=linux GOARCH=amd64 go build -o release/allorad_linux_amd64 cmd/allorad/main.go
GOOS=windows GOARCH=arm64 go build -o release/allorad_windows_arm64.exe cmd/allorad/main.go
GOOS=windows GOARCH=amd64 go build -o release/allorad_windows_amd64.exe cmd/allorad/main.go
- name: Delete the "latest" Release
uses: dev-drprasad/delete-tag-and-release@v0.2.1
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ For the latest documentation, please go to https://docs.allora.network/

## Allorad Install

Binary can be Installed for Linux or Mac (check releases for Windows)

```bash
curl -sSL https://raw.githubusercontent.com/allora-network/allora-chain/main/install.sh | bash
```

Ensure `~/.local/bin` is in your PATH.

`allorad` will be available.

```sh
git clone -b <latest-release-tag> https://github.com/allora-network/allora-chain.git
cd allora-chain && make install
Expand Down
49 changes: 49 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# Define the application name
APP_NAME="allorad"

# Check for a version argument, otherwise set a default version
VERSION=${1:-"v0.0.9"}

# Define the base URL using the specified or default version
BASE_URL="https://github.com/allora-network/allora-chain/releases/download/$VERSION"

# Determine the operating system and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

case $ARCH in
x86_64)
ARCH="amd64"
;;
arm64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac

# Construct the download URL
URL="${BASE_URL}/${APP_NAME}_${OS}_${ARCH}"

# Define the target directory
TARGET_DIR="$HOME/.local/bin"

# Create the target directory if it doesn't exist
mkdir -p "$TARGET_DIR"

# Download the file to /tmp
wget -O "/tmp/${APP_NAME}" "$URL"

# Move the binary to the target directory
mv "/tmp/${APP_NAME}" "$TARGET_DIR"

# Change permissions to make it executable
chmod +x "$TARGET_DIR/$APP_NAME"

echo "Installation complete. The $APP_NAME is now available in $TARGET_DIR"
echo "To make $APP_NAME available from any terminal session, add the following line to your .bashrc or .zshrc:"
echo "export PATH=\"\$PATH:$TARGET_DIR\""

0 comments on commit 7560577

Please sign in to comment.