diff --git a/.github/workflows/zxc-verify-docker-build-determinism.yaml b/.github/workflows/zxc-verify-docker-build-determinism.yaml index 0fb3c1473..76b9d6e37 100644 --- a/.github/workflows/zxc-verify-docker-build-determinism.yaml +++ b/.github/workflows/zxc-verify-docker-build-determinism.yaml @@ -164,10 +164,44 @@ jobs: run: | mkdir -p "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/data" - echo "::group::Copying Library Artifacts" - cp -Rvf "${{ github.workspace }}/hedera-node/data/lib" "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/data/" - echo "::endgroup::" - echo "::group::Copying Application Artifacts" cp -Rvf "${{ github.workspace }}/hedera-node/data/apps" "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/data/" echo "::endgroup::" + + - name: Write Artifact Version Descriptor + run: | + printf "VERSION=%s\nCOMMIT=%s\nDATE=%s" "$(./gradlew -q showVersion)" "$(git log -1 --format='%H' | cut -c1-8)" "$(date -u)" | tee "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/VERSION" + + - name: Build Docker Image + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 + env: + SOURCE_DATE_EPOCH: ${{ steps.commit.outputs.source-date }} + if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} + with: + push: true + no-cache: true + platforms: linux/amd64,linux/arm64 + build-args: | + SOURCE_DATE_EPOCH=${{ steps.commit.outputs.source-date }} + context: ${{ env.DOCKER_CONTEXT_PATH }} + tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ steps.commit.outputs.sha-abbrev }} + + - name: Generate Manifest + id: manifest + env: + MANIFEST_PATH: ${{ env.DOCKER_MANIFEST_PATH }} + if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} + run: GITHUB_SHA="${{ needs.generate-baseline.outputs.sha-abbrev }}" ${{ env.DOCKER_MANIFEST_GENERATOR }} + + - name: Amend Manifest with Gradle Artifacts + if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} + working-directory: ${{ env.DOCKER_MANIFEST_PATH }} + run: | + EXTRACTED_FILE_NAME="${{ steps.commit.outputs.sha }}.tar" + gunzip "${{ steps.manifest.outputs.name }}" + tar -rvf "${EXTRACTED_FILE_NAME}" -C "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}" sdk + gzip "${EXTRACTED_FILE_NAME}" + + - name: Upload Baseline + if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} + run: gsutil cp "${{ steps.manifest.outputs.file }}" "${{ steps.baseline.outputs.file }}"