2024-06-05 11:33:51 +00:00
|
|
|
version: 2
|
|
|
|
|
2022-09-08 11:27:05 +00:00
|
|
|
before:
|
|
|
|
hooks:
|
2024-06-05 11:33:51 +00:00
|
|
|
- go mod download
|
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
builds:
|
|
|
|
- env:
|
|
|
|
- CGO_ENABLED=0
|
|
|
|
mod_timestamp: '{{ .CommitTimestamp }}'
|
|
|
|
flags:
|
|
|
|
- -trimpath
|
|
|
|
ldflags:
|
|
|
|
- '-s -w'
|
2023-05-16 16:35:39 +00:00
|
|
|
- -X github.com/databricks/cli/internal/build.buildProjectName={{ .ProjectName }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildVersion={{ .Version }}
|
Include build information and add version command (#194)
Includes relevant fields listed on
https://goreleaser.com/customization/templates/ into build artifacts.
The version command outputs the version by default:
```
$ bricks version
0.0.21-devel
```
Or all build information if `--json` is specified:
```
$ bricks version --json
{
"ProjectName": "bricks",
"Version": "0.0.21-devel",
"Branch": "version-info",
"Tag": "v0.0.20",
"ShortCommit": "193b56b",
"FullCommit": "193b56b0929128c0836d35e913c46fd66fa2a93c",
"CommitTime": "2023-02-02T22:04:42+01:00",
"Summary": "v0.0.20-5-g193b56b",
"Major": 0,
"Minor": 0,
"Patch": 20,
"Prerelease": "",
"IsSnapshot": true,
"BuildTime": "2023-02-02T22:07:36+01:00"
}
```
2023-02-03 14:38:53 +00:00
|
|
|
|
|
|
|
# Git information
|
2023-05-16 16:35:39 +00:00
|
|
|
- -X github.com/databricks/cli/internal/build.buildBranch={{ .Branch }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildTag={{ .Tag }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildShortCommit={{ .ShortCommit }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildFullCommit={{ .FullCommit }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildCommitTimestamp={{ .CommitTimestamp }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildSummary={{ .Summary }}
|
Include build information and add version command (#194)
Includes relevant fields listed on
https://goreleaser.com/customization/templates/ into build artifacts.
The version command outputs the version by default:
```
$ bricks version
0.0.21-devel
```
Or all build information if `--json` is specified:
```
$ bricks version --json
{
"ProjectName": "bricks",
"Version": "0.0.21-devel",
"Branch": "version-info",
"Tag": "v0.0.20",
"ShortCommit": "193b56b",
"FullCommit": "193b56b0929128c0836d35e913c46fd66fa2a93c",
"CommitTime": "2023-02-02T22:04:42+01:00",
"Summary": "v0.0.20-5-g193b56b",
"Major": 0,
"Minor": 0,
"Patch": 20,
"Prerelease": "",
"IsSnapshot": true,
"BuildTime": "2023-02-02T22:07:36+01:00"
}
```
2023-02-03 14:38:53 +00:00
|
|
|
|
|
|
|
# Version information
|
2023-05-16 16:35:39 +00:00
|
|
|
- -X github.com/databricks/cli/internal/build.buildMajor={{ .Major }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildMinor={{ .Minor }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildPatch={{ .Patch }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildPrerelease={{ .Prerelease }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildIsSnapshot={{ .IsSnapshot }}
|
|
|
|
- -X github.com/databricks/cli/internal/build.buildTimestamp={{ .Timestamp }}
|
Include build information and add version command (#194)
Includes relevant fields listed on
https://goreleaser.com/customization/templates/ into build artifacts.
The version command outputs the version by default:
```
$ bricks version
0.0.21-devel
```
Or all build information if `--json` is specified:
```
$ bricks version --json
{
"ProjectName": "bricks",
"Version": "0.0.21-devel",
"Branch": "version-info",
"Tag": "v0.0.20",
"ShortCommit": "193b56b",
"FullCommit": "193b56b0929128c0836d35e913c46fd66fa2a93c",
"CommitTime": "2023-02-02T22:04:42+01:00",
"Summary": "v0.0.20-5-g193b56b",
"Major": 0,
"Minor": 0,
"Patch": 20,
"Prerelease": "",
"IsSnapshot": true,
"BuildTime": "2023-02-02T22:07:36+01:00"
}
```
2023-02-03 14:38:53 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
goos:
|
|
|
|
- windows
|
|
|
|
- linux
|
|
|
|
- darwin
|
|
|
|
goarch:
|
|
|
|
- amd64
|
|
|
|
- arm64
|
2023-05-16 16:35:39 +00:00
|
|
|
binary: databricks
|
2024-06-05 11:33:51 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
archives:
|
|
|
|
- format: zip
|
2023-04-12 20:16:30 +00:00
|
|
|
|
|
|
|
# Include version in archive only for release builds and not for snapshot builds.
|
|
|
|
# Snapshot archives must have a stable file name such that the artifacts in the nightly
|
|
|
|
# release are automatically overwritten. If the snapshot version is included in the
|
|
|
|
# file name then additional logic to clean up older builds would be needed.
|
2023-05-16 16:35:39 +00:00
|
|
|
name_template: 'databricks_cli_{{ if not .IsSnapshot }}{{ .Version }}_{{ end }}{{ .Os }}_{{ .Arch }}'
|
2023-04-12 20:16:30 +00:00
|
|
|
|
2024-04-12 15:22:30 +00:00
|
|
|
dockers:
|
|
|
|
- id: arm64
|
|
|
|
goarch: arm64
|
|
|
|
# We need to use buildx to build arm64 image on a amd64 machine.
|
|
|
|
use: buildx
|
|
|
|
image_templates:
|
|
|
|
# Docker tags can't have "+" in them, so we replace it with "-"
|
|
|
|
- 'ghcr.io/databricks/cli:{{replace .Version "+" "-"}}-arm64'
|
|
|
|
- 'ghcr.io/databricks/cli:latest-arm64'
|
|
|
|
build_flag_templates:
|
|
|
|
- "--build-arg=ARCH=arm64"
|
|
|
|
- "--platform=linux/arm64"
|
|
|
|
extra_files:
|
|
|
|
- "./docker/config.tfrc"
|
|
|
|
- "./docker/setup.sh"
|
|
|
|
|
|
|
|
- id: amd64
|
|
|
|
goarch: amd64
|
|
|
|
use: buildx
|
|
|
|
image_templates:
|
|
|
|
# Docker tags can't have "+" in them, so we replace it with "-"
|
|
|
|
- 'ghcr.io/databricks/cli:{{replace .Version "+" "-"}}-amd64'
|
|
|
|
- 'ghcr.io/databricks/cli:latest-amd64'
|
|
|
|
build_flag_templates:
|
|
|
|
- "--build-arg=ARCH=amd64"
|
|
|
|
- "--platform=linux/amd64"
|
|
|
|
extra_files:
|
|
|
|
- "./docker/config.tfrc"
|
|
|
|
- "./docker/setup.sh"
|
|
|
|
|
2024-04-16 11:26:19 +00:00
|
|
|
docker_manifests:
|
|
|
|
- name_template: ghcr.io/databricks/cli:{{replace .Version "+" "-"}}
|
|
|
|
image_templates:
|
|
|
|
- ghcr.io/databricks/cli:{{replace .Version "+" "-"}}-amd64
|
|
|
|
- ghcr.io/databricks/cli:{{replace .Version "+" "-"}}-arm64
|
|
|
|
- name_template: ghcr.io/databricks/cli:latest
|
|
|
|
image_templates:
|
|
|
|
- ghcr.io/databricks/cli:latest-amd64
|
|
|
|
- ghcr.io/databricks/cli:latest-arm64
|
|
|
|
|
2024-04-12 15:22:30 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
checksum:
|
2023-05-16 16:35:39 +00:00
|
|
|
name_template: 'databricks_cli_{{ .Version }}_SHA256SUMS'
|
2022-05-13 15:43:54 +00:00
|
|
|
algorithm: sha256
|
2024-06-05 11:33:51 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
snapshot:
|
2023-02-20 14:46:57 +00:00
|
|
|
name_template: '{{ incpatch .Version }}-dev+{{ .ShortCommit }}'
|
2024-06-05 11:33:51 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
changelog:
|
|
|
|
sort: asc
|
|
|
|
filters:
|
|
|
|
exclude:
|
|
|
|
- '^docs:'
|
|
|
|
- '^test:'
|