From 1b3659dc4696ee0dccd6fd64958345bd4df1ec74 Mon Sep 17 00:00:00 2001 From: Haneen Hany <124837763+khalifaa55@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:30:50 +0300 Subject: [PATCH] fix: Lido Exporter Release (#415) * 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 --- .github/workflows/lido-exporter.yml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lido-exporter.yml b/.github/workflows/lido-exporter.yml index 0a06191e..4ae1b3d6 100644 --- a/.github/workflows/lido-exporter.yml +++ b/.github/workflows/lido-exporter.yml @@ -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 @@ -32,6 +32,12 @@ 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: @@ -39,10 +45,10 @@ jobs: 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 @@ -50,18 +56,24 @@ jobs: 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 \ No newline at end of file