Skip to content

Commit

Permalink
fix: Lido Exporter Release (#415)
Browse files Browse the repository at this point in the history
* fix: Version variable

* refac: Adjust version extraction

* test: Release lido-exporter

* test: Check version

* fix: Deprecated output step

* fix: Lido Exporter release version

* fix: Remove comments
  • Loading branch information
khalifaa55 authored Sep 25, 2024
1 parent e928e97 commit 1b3659d
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/lido-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:

permissions:
contents: write
packages: write

jobs:
build:
name: Create and Push Docker Image
runs-on: ubuntu-latest
env:
FULL_VERSION: ${{ github.ref_name }}
VERSION: ${FULL_VERSION#lido-exporter-}
FULL_VERSION: ${{ github.ref_name }}

steps:
- name: Checkout code
Expand All @@ -32,36 +32,48 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Extract version
id: extract_version
run: |
Ver=${{ env.FULL_VERSION }}
echo "version=${Ver#lido-exporter-}" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./cmd/lido-exporter/Dockerfile
push: true
tags: |
nethermindeth/lido-exporter:${{env.VERSION}}
nethermindeth/lido-exporter:${{ steps.extract_version.outputs.version }}
nethermindeth/lido-exporter:latest
build-args: |
VERSION=${{ env.VERSION }}
VERSION=${{ steps.extract_version.outputs.version }}
- name: Log out of Docker Hub
run: docker logout

create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build # This makes the create-release job dependent on the build job
env:
FULL_VERSION: ${{ github.ref_name }}
VERSION: ${FULL_VERSION#lido-exporter-}
FULL_VERSION: ${{ github.ref_name }}

steps:
- name: Extract version
id: extract_version
run: |
Ver=${{ env.FULL_VERSION }}
echo "version=${Ver#lido-exporter-}" >> $GITHUB_OUTPUT # Updated to use GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{env.VERSION}}
draft: false
tag: ${{ steps.extract_version.outputs.version }}
draft: true
prerelease: false
generateReleaseNotes: true

0 comments on commit 1b3659d

Please sign in to comment.