Add simple one-arg stamped build script

This commit is contained in:
beatz174-bit
2026-04-23 14:02:05 +10:00
parent 6122665cfd
commit f10635f744
2 changed files with 54 additions and 2 deletions
+12 -2
View File
@@ -70,10 +70,20 @@ The provider embeds build metadata (`version`, `commit`, `date`) in the binary.
- `./terraform-provider-dynu --version`
- `./terraform-provider-dynu version`
Build a stamped binary with standard Go `-ldflags`:
Primary build method (recommended):
```bash
VERSION=${VERSION:-v0.2.0}
./build.sh v0.2.0
```
`build.sh` takes exactly one argument (the version string), then derives commit and date automatically:
- `COMMIT=$(git rev-parse --short HEAD)`
- `DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)`
Manual equivalent (same stamped build command used by `build.sh`):
```bash
VERSION=v0.2.0
COMMIT=$(git rev-parse --short HEAD)
DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)