From c17323958b1ef5da0eecd70e36b0074c5f5e69ed Mon Sep 17 00:00:00 2001 From: init4samwise Date: Wed, 11 Mar 2026 17:42:14 +0000 Subject: [PATCH] fix: extract RELEASE_VERSION dynamically from rel/config.exs The Dockerfile copies config_helper.exs to /app/releases/${RELEASE_VERSION}/ This must match the Elixir release version defined in rel/config.exs. Now extracts the version dynamically with: grep -oP 'set version: "\K[^"]+' rel/config.exs This way it stays in sync with upstream without manual updates. --- .github/workflows/publish-init4-docker.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-init4-docker.yml b/.github/workflows/publish-init4-docker.yml index a4f02f1db043..b5b62df5c5d3 100644 --- a/.github/workflows/publish-init4-docker.yml +++ b/.github/workflows/publish-init4-docker.yml @@ -34,12 +34,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract version from tag + - name: Extract versions id: version run: | VERSION=${GITHUB_REF_NAME#v} echo "version=$VERSION" >> $GITHUB_OUTPUT echo "short_sha=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT + # Extract Elixir release version from rel/config.exs + RELEASE_VERSION=$(grep -oP 'set version: "\K[^"]+' rel/config.exs) + echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT - name: Build and push by digest id: build @@ -54,7 +57,7 @@ jobs: cache-to: type=gha,scope=amd64,mode=max build-args: | BLOCKSCOUT_VERSION=${{ github.ref_name }}+commit.${{ steps.version.outputs.short_sha }} - RELEASE_VERSION=${{ steps.version.outputs.version }} + RELEASE_VERSION=${{ steps.version.outputs.release_version }} build-arm64: name: Build arm64 @@ -76,12 +79,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract version from tag + - name: Extract versions id: version run: | VERSION=${GITHUB_REF_NAME#v} echo "version=$VERSION" >> $GITHUB_OUTPUT echo "short_sha=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT + # Extract Elixir release version from rel/config.exs + RELEASE_VERSION=$(grep -oP 'set version: "\K[^"]+' rel/config.exs) + echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT - name: Build and push by digest id: build @@ -96,7 +102,7 @@ jobs: cache-to: type=gha,scope=arm64,mode=max build-args: | BLOCKSCOUT_VERSION=${{ github.ref_name }}+commit.${{ steps.version.outputs.short_sha }} - RELEASE_VERSION=${{ steps.version.outputs.version }} + RELEASE_VERSION=${{ steps.version.outputs.release_version }} merge: name: Create multi-arch manifest