fix(dagger): correctly inject version number during build (#6596)

* fix(dagger): correctly inject version number during build

* test version

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
Leonardo Cecchi 2024-07-02 17:06:42 +02:00 committed by GitHub
parent ede2c6176d
commit 6167620a57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,16 +21,14 @@ build:
LDFLAGS:
- -s
- -w
- -X go.dagger.io/dagger/version.Version={{ version }}
- -X go.dagger.io/dagger/version.Revision=tea
- -X github.com/dagger/dagger/engine.Version={{ version }}
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
- -buildmode=pie
test: |
dagger version
test: dagger version | grep '{{version}}'
# This is a better test, but we might mask failures using || true
# think more about this.
#out=$(dagger query <<EOF 2>&1 || true