diun icon indicating copy to clipboard operation
diun copied to clipboard

ci: use docker github builder to build the image

Open crazy-max opened this issue 1 month ago • 1 comments

https://github.com/docker/github-builder-experimental/issues/21

crazy-max avatar Nov 13 '25 13:11 crazy-max

https://github.com/crazy-max/diun/actions/runs/19333611496/job/55303090837#step:8:560


#38 [linux/amd64 build 1/1] RUN --mount=type=bind,target=.     --mount=type=bind,from=version,source=/tmp/.version,target=/tmp/.version     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod <<EOT (set -ex...)
#38 0.111 + cat /tmp/.version
#38 0.113 + xx-go build -trimpath -ldflags '-s -w -X main.version=8f3d03f' -o /usr/bin/diun ./cmd
#38 ...

Seems git context doesn't fetch full history so versioning is broken.

Before when using path context and @action/checkout with fetch-depth: 0: https://github.com/crazy-max/diun/blob/cfc7fdb6b847a969483358bfeccadb637f1467db/.github/workflows/build.yml#L244-L248

We had: https://github.com/crazy-max/diun/actions/runs/19331978878/job/55297510739#step:8:596

#40 [linux/amd64->ppc64le build 1/1] RUN --mount=type=bind,target=.     --mount=type=bind,from=version,source=/tmp/.version,target=/tmp/.version     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod <<EOT (set -ex...)
#40 0.098 + cat /tmp/.version
#40 0.102 + xx-go build -trimpath -ldflags '-s -w -X main.version=v4.30.0-30-g42da408e' -o /usr/bin/diun ./cmd
#40 ...

@tonistiigi I wonder if we could have a new query param for git context to set fetch-depth similar to @action/checkout:

  • https://github.com/actions/checkout/blob/71cf2267d89c5cb81562390fa70a37fa40b1305e/src/git-source-provider.ts#L172-L185
  • https://github.com/actions/checkout/blob/71cf2267d89c5cb81562390fa70a37fa40b1305e/src/ref-helper.ts#L69-L77
  • https://github.com/actions/checkout/blob/71cf2267d89c5cb81562390fa70a37fa40b1305e/action.yml#L74-L76

crazy-max avatar Nov 13 '25 15:11 crazy-max