Skip to content

Commit

Permalink
feat: automatically update the Hermes binaries and bump to v1.8.2 (#27
Browse files Browse the repository at this point in the history
)

* bump hermes to v1.8.2

* automatic update the hermes binaries

* add PR body message

* add body disclaimer

---------

Co-authored-by: Pantani <Pantani>
  • Loading branch information
Pantani authored Apr 19, 2024
1 parent daaa865 commit 2d08bf0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
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

0 comments on commit 2d08bf0

Please sign in to comment.