From 7d4966f904485a3e18227bf607ae67753e18860c Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 19 Jan 2025 13:19:08 -0500 Subject: embed version better? Signed-off-by: Xe Iaso --- .dockerignore | 1 - .github/workflows/earthly.yml | 4 ++-- Earthfile | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index f248abe..1135171 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,2 @@ -.git bin kube \ No newline at end of file diff --git a/.github/workflows/earthly.yml b/.github/workflows/earthly.yml index 2768fbd..5ca54d8 100644 --- a/.github/workflows/earthly.yml +++ b/.github/workflows/earthly.yml @@ -40,9 +40,9 @@ jobs: if: github.event_name != 'pull_request' id: build-and-push run: | - earthly --org me-2625 --sat alpha --ci --push +all --VERSION=$(git describe --tags) + earthly --org me-2625 --sat alpha --ci --push +all - name: Build Docker image if: github.event_name == 'pull_request' id: build run: | - earthly --org me-2625 --sat alpha --ci +all --VERSION=$(git describe --tags) \ No newline at end of file + earthly --org me-2625 --sat alpha --ci +all \ No newline at end of file diff --git a/Earthfile b/Earthfile index 7ef0c64..5002c36 100644 --- a/Earthfile +++ b/Earthfile @@ -26,9 +26,8 @@ deps: everything: FROM +deps - ARG VERSION=no-version-error - COPY . . + ARG VERSION=$(git describe --tags --always --dirty) RUN mkdir -p bin RUN --mount=type=cache,target=/root/.cache GOBIN=$(pwd)/bin go install -ldflags="-X within.website/x.Version="${VERSION} ./... -- cgit v1.2.3