Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatically update the Hermes binaries and bump to v1.8.2 #27

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/gen-hermes-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Generate Hermes binaries

on:
push:
branches:
- main
paths:
- 'hermes/*.go'
- 'scripts/gen-hermes'
schedule:
- cron: "0 0 * * *" # every day at midnight

jobs:
gen-hermes:
Expand All @@ -24,6 +20,9 @@ jobs:
with:
title: "feat(hermes): update binaries"
commit-message: "feat(hermes): update binaries"
body: ""
body: |
### DISCLAIMER
**After merging this PR, create a release tag based on the Hermes binary version using this pattern: `hermes/<HERMES-BINARY-VERSION>`.**
_Eg: `hermes/v1.8.2`_
branch: feat/gen-hermes
delete-branch: true
Binary file modified hermes/hermes-aarch64-apple-darwin.tar.gz
Binary file not shown.
Binary file modified hermes/hermes-aarch64-unknown-linux-gnu.tar.gz
Binary file not shown.
Binary file modified hermes/hermes-x86_64-apple-darwin.tar.gz
Binary file not shown.
Binary file modified hermes/hermes-x86_64-unknown-linux-gnu.tar.gz
Binary file not shown.
18 changes: 17 additions & 1 deletion scripts/gen-hermes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ 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"

# Get the latest hermes binary version from the ignite-files repo tag
HERMES_TAG=$(git ls-remote 2>/dev/null | grep -o 'hermes/v[0-9.]*$' | cut -c 8- | tail -n 1)

echo "Latest Hermes Release: $LATEST_TAG"
echo "Current Hermes Binary: $HERMES_TAG"

# Function to compare versions
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }

# Check if there's a new release
if version_gt "$LATEST_TAG" "$HERMES_TAG"; then
echo "A new release ($LATEST_TAG) is available. Downloading binaries..."
else
echo "No new release found."
exit 0
fi

# Loop through each platform and download the corresponding binary
PLATFORMS=("aarch64-apple-darwin" "aarch64-unknown-linux-gnu" "x86_64-apple-darwin" "x86_64-unknown-linux-gnu")
Expand Down
Loading