Skip to content

Commit

Permalink
Test push
Browse files Browse the repository at this point in the history
  • Loading branch information
leeren committed Aug 19, 2024
1 parent cdf830a commit 9660539
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/ci-geth-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Upload geth Binary
on:
push:
branches:
- main
- feat/add-multi-arch-build

permissions:
id-token: write
Expand Down Expand Up @@ -39,6 +39,23 @@ jobs:
aws-region: us-west-1
role-session-name: github-actions

- name: Extract the version
run: |
PARAMS_FILE="./params/version.go"
VERSION_MAJOR=$(awk -F= '/VersionMajor/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
VERSION_MINOR=$(awk -F= '/VersionMinor/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
VERSION_PATCH=$(awk -F= '/VersionPatch/ {gsub(/[^0-9]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
VERSION_META=$(awk -F= '/VersionMeta/ {gsub(/"|[^a-zA-Z]/, "", $2); printf "%s", $2}' $PARAMS_FILE)
# Construct the full version string
VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
if [ "$VERSION_META" != "stable" ]; then
VERSION+="-${VERSION_META}"
fi
echo "Version extracted: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build the geth binary
run: |
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
Expand All @@ -65,8 +82,7 @@ jobs:
run: |
export TZ=America/Los_Angeles
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
# VERSION should be changed later to use the latest release tag
VERSION=$(date +%Y%m%d%H%M%S)
TIMESTAMP=$(date +%Y%m%d%H%M%S)
HUMAN_READABLE_VERSION=$(date)
COMMIT_HASH=$(git rev-parse --short HEAD)
FOLDER_NAME="geth-${{ matrix.platform }}-${VERSION}-${COMMIT_HASH}"
Expand All @@ -81,12 +97,12 @@ jobs:
if [ "${{ matrix.platform }}" = "linux-amd64" ]; then
echo "Uploading binary for internal use..."
aws s3 cp $binary_name s3://iliad-geth-binaries/geth/geth-$VERSION --quiet
aws s3 cp $binary_name s3://iliad-geth-binaries/geth/geth-$TIMESTAMP-leeren --quiet
# Update manifest file for linux-amd64 builds only
aws s3 cp s3://iliad-geth-binaries/geth/manifest.txt manifest.txt --quiet || touch manifest.txt
echo $VERSION >> manifest.txt
aws s3 cp manifest.txt s3://iliad-geth-binaries/geth/manifest.txt --quiet
aws s3 cp s3://iliad-geth-binaries/geth/manifest-leeren.txt manifest-leeren.txt --quiet || touch manifest.txt
echo $TIMESTAMP >> manifest-leeren.txt
aws s3 cp manifest-leeren.txt s3://iliad-geth-binaries/geth/manifest-leeren.txt --quiet
fi
mkdir $FOLDER_NAME
Expand Down

0 comments on commit 9660539

Please sign in to comment.