Skip to content

Commit

Permalink
update hermes binaries to 1.7.3 and add a script to download automati…
Browse files Browse the repository at this point in the history
…cally
  • Loading branch information
Pantani authored and Pantani committed Dec 13, 2023
1 parent 7158ca3 commit c06da13
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gen-gex-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate nodetime binaries
name: Generate GEX binaries

on:
push:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/gen-hermes-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Generate Hermes binaries

on:
push:
branches:
- main
paths:
- 'hermes/*.go'
- 'scripts/gen-hermes'

jobs:
gen-hermes:
name: "Generate hermes binaries"
runs-on: ubuntu-latest
concurrency: gen-hermes
steps:
- uses: actions/checkout@v3

- run: ./scripts/gen-hermes

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
title: "feat(hermes): update binaries"
commit-message: "feat(hermes): update binaries"
body: ""
branch: feat/gen-hermes
delete-branch: true
2 changes: 1 addition & 1 deletion hermes/data_darwin_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package hermes

import _ "embed" // embed is required for binary embedding.

//go:embed hermes-v1.7.1-x86_64-apple-darwin.tar.gz
//go:embed hermes-x86_64-apple-darwin.tar.gz
var binaryCompressed []byte
2 changes: 1 addition & 1 deletion hermes/data_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package hermes

import _ "embed" // embed is required for binary embedding.

//go:embed hermes-v1.7.1-aarch64-apple-darwin.tar.gz
//go:embed hermes-aarch64-apple-darwin.tar.gz
var binaryCompressed []byte
2 changes: 1 addition & 1 deletion hermes/data_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package hermes

import _ "embed" // embed is required for binary embedding.

//go:embed hermes-v1.7.1-x86_64-unknown-linux-gnu.tar.gz
//go:embed hermes-x86_64-unknown-linux-gnu.tar.gz
var binaryCompressed []byte
2 changes: 1 addition & 1 deletion hermes/data_linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package hermes

import _ "embed" // embed is required for binary embedding.

//go:embed hermes-v1.7.1-aarch64-unknown-linux-gnu.tar.gz
//go:embed hermes-aarch64-unknown-linux-gnu.tar.gz
var binaryCompressed []byte
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
34 changes: 34 additions & 0 deletions scripts/gen-hermes
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Define the repository URL and the folder where you want to save the binaries
LAST_RELEASE_API="https://api.github.com/repos/informalsystems/hermes/releases/latest"
REPO_URL="https://github.com/informalsystems/hermes"
DEST_FOLDER="hermes"

# Get the latest release version from GitHub API
RELEASE_INFO=$(curl -s -L "$LAST_RELEASE_API")
LATEST_TAG=$(echo "$RELEASE_INFO" | grep -o '"tag_name": "[^"]*' | grep -o '[^"]*$')
echo "Download Hermes $LATEST_TAG binaries"

# Loop through each platform and download the corresponding binary
#hermes-v1.7.3-x86_64-unknown-linux-gnu.zip
PLATFORMS=("aarch64-apple-darwin" "aarch64-unknown-linux-gnu" "x86_64-apple-darwin" "x86_64-unknown-linux-gnu")
for PLATFORM in "${PLATFORMS[@]}"; do
BINARY_NAME="hermes-$LATEST_TAG-$PLATFORM.tar.gz"
DOWNLOAD_URL="$REPO_URL/releases/download/$LATEST_TAG/$BINARY_NAME"
NEW_BINARY_NAME="hermes-$PLATFORM.tar.gz"
DEST_FILE="$DEST_FOLDER/$NEW_BINARY_NAME"

# Download the binary
echo "Downloading $BINARY_NAME..."
curl -sL "$DOWNLOAD_URL" -o "$DEST_FILE"

# Check if the download was successful
if [ $? -eq 0 ]; then
echo "Downloaded $BINARY_NAME to $DEST_FILE"
else
echo "Failed to download $BINARY_NAME"
fi
done

echo "All binaries downloaded to $DEST_FOLDER"

0 comments on commit c06da13

Please sign in to comment.