-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from ethpandaops/feat/alpha-releases
feat: Alpha releases
- Loading branch information
Showing
5 changed files
with
160 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: alpha releases | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'release/*' | ||
|
||
jobs: | ||
tag-release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.ref }} | ||
token: ${{ secrets.EPOBOT_TOKEN }} | ||
- name: Get latest release version for this release branch | ||
if: startsWith(github.ref, 'refs/heads/release/') | ||
id: latest_version | ||
run: | | ||
# Extract suffix from branch name (e.g., 'dencun' from 'release/dencun') | ||
RELEASE_SUFFIX=${GITHUB_REF#refs/heads/release/} | ||
# Fetch all tags and get the latest that matches the pattern | ||
# Using the refs/tags API | ||
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/git/refs/tags" \ | ||
| jq -r --arg suffix "$RELEASE_SUFFIX" '.[] | select(.ref | test("refs/tags/v?[0-9]+\\.[0-9]+\\.[0-9]+-" + $suffix + "$")) | .ref' \ | ||
| sed 's|refs/tags/||' | sort -V | tail -n 1) | ||
echo "Found latest $RELEASE_SUFFIX version: $LATEST_VERSION" | ||
# Default to 0.0.0 if no matching release was found | ||
if [[ -z "$LATEST_VERSION" ]]; then | ||
LATEST_VERSION="0.0.0" | ||
fi | ||
# Increment the patch version using bash | ||
LATEST_VERSION=$(echo "$LATEST_VERSION" | awk -F. -v OFS=. '{$NF = $NF + 1;} 1') | ||
VERSION=$LATEST_VERSION-$RELEASE_SUFFIX | ||
echo "Releasing version: $VERSION" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ethpandaopsbot" | ||
# Log the short commit SHA | ||
SHORT_COMMIT=$(git rev-parse --short HEAD) | ||
echo "Git commit: $SHORT_COMMIT" | ||
git tag -a "$VERSION" -m "Release $VERSION" | ||
echo "RELEASE_SUFFIX=$RELEASE_SUFFIX" >> $GITHUB_ENV | ||
# Push the tag | ||
git push origin "$VERSION" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.EPOBOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Go", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"program": "${workspaceRoot}", | ||
"args": [ | ||
"--config", | ||
"${workspaceRoot}/config.yaml" | ||
], | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM debian:latest | ||
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \ | ||
libssl-dev \ | ||
ca-certificates \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY ethereum-metrics-exporter* /ethereum-metrics-exporter | ||
ENTRYPOINT ["/ethereum-metrics-exporter"] |