mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
fix(docker): pass vergen git vars as build args (#21384)
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
11
.github/workflows/docker.yml
vendored
11
.github/workflows/docker.yml
vendored
@@ -50,6 +50,13 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get git info for vergen
|
||||
id: git
|
||||
run: |
|
||||
echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
|
||||
echo "describe=$(git describe --always --tags)" >> "$GITHUB_OUTPUT"
|
||||
echo "dirty=false" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Determine build parameters
|
||||
id: params
|
||||
run: |
|
||||
@@ -82,6 +89,10 @@ jobs:
|
||||
|
||||
- name: Build and push images
|
||||
uses: depot/bake-action@v1
|
||||
env:
|
||||
VERGEN_GIT_SHA: ${{ steps.git.outputs.sha }}
|
||||
VERGEN_GIT_DESCRIBE: ${{ steps.git.outputs.describe }}
|
||||
VERGEN_GIT_DIRTY: ${{ steps.git.outputs.dirty }}
|
||||
with:
|
||||
project: ${{ vars.DEPOT_PROJECT_ID }}
|
||||
files: docker-bake.hcl
|
||||
|
||||
@@ -44,6 +44,14 @@ ENV RUSTFLAGS="$RUSTFLAGS"
|
||||
ARG FEATURES=""
|
||||
ENV FEATURES=$FEATURES
|
||||
|
||||
# Git info for vergen (since .git is excluded from Docker context)
|
||||
ARG VERGEN_GIT_SHA=""
|
||||
ARG VERGEN_GIT_DESCRIBE=""
|
||||
ARG VERGEN_GIT_DIRTY="false"
|
||||
ENV VERGEN_GIT_SHA=$VERGEN_GIT_SHA
|
||||
ENV VERGEN_GIT_DESCRIBE=$VERGEN_GIT_DESCRIBE
|
||||
ENV VERGEN_GIT_DIRTY=$VERGEN_GIT_DIRTY
|
||||
|
||||
# Build dependencies with cache mounts
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
|
||||
|
||||
@@ -20,6 +20,19 @@ variable "FEATURES" {
|
||||
default = "jemalloc asm-keccak min-debug-logs"
|
||||
}
|
||||
|
||||
// Git info for vergen (since .git is excluded from Docker context)
|
||||
variable "VERGEN_GIT_SHA" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "VERGEN_GIT_DESCRIBE" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "VERGEN_GIT_DIRTY" {
|
||||
default = "false"
|
||||
}
|
||||
|
||||
// Common settings for all targets
|
||||
group "default" {
|
||||
targets = ["ethereum", "optimism"]
|
||||
@@ -34,8 +47,11 @@ target "_base" {
|
||||
dockerfile = "Dockerfile.depot"
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
args = {
|
||||
BUILD_PROFILE = "${BUILD_PROFILE}"
|
||||
FEATURES = "${FEATURES}"
|
||||
BUILD_PROFILE = "${BUILD_PROFILE}"
|
||||
FEATURES = "${FEATURES}"
|
||||
VERGEN_GIT_SHA = "${VERGEN_GIT_SHA}"
|
||||
VERGEN_GIT_DESCRIBE = "${VERGEN_GIT_DESCRIBE}"
|
||||
VERGEN_GIT_DIRTY = "${VERGEN_GIT_DIRTY}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user