|
| 1 | +version: 2 |
| 2 | + |
| 3 | +before: |
| 4 | + hooks: |
| 5 | + - go mod download |
| 6 | + |
| 7 | +builds: |
| 8 | + - id: unix |
| 9 | + main: ./.github/release-test |
| 10 | + env: |
| 11 | + - CGO_ENABLED=0 |
| 12 | + mod_timestamp: '{{ .CommitTimestamp }}' |
| 13 | + flags: |
| 14 | + - -trimpath |
| 15 | + ldflags: &ldflags |
| 16 | + - '-s -w' |
| 17 | + - -X github.com/databricks/cli/internal/build.buildProjectName={{ .ProjectName }} |
| 18 | + - -X github.com/databricks/cli/internal/build.buildVersion={{ .Version }} |
| 19 | + |
| 20 | + # Git information |
| 21 | + - -X github.com/databricks/cli/internal/build.buildBranch={{ .Branch }} |
| 22 | + - -X github.com/databricks/cli/internal/build.buildTag={{ .Tag }} |
| 23 | + - -X github.com/databricks/cli/internal/build.buildShortCommit={{ .ShortCommit }} |
| 24 | + - -X github.com/databricks/cli/internal/build.buildFullCommit={{ .FullCommit }} |
| 25 | + - -X github.com/databricks/cli/internal/build.buildCommitTimestamp={{ .CommitTimestamp }} |
| 26 | + - -X github.com/databricks/cli/internal/build.buildSummary={{ .Summary }} |
| 27 | + |
| 28 | + # Version information |
| 29 | + - -X github.com/databricks/cli/internal/build.buildMajor={{ .Major }} |
| 30 | + - -X github.com/databricks/cli/internal/build.buildMinor={{ .Minor }} |
| 31 | + - -X github.com/databricks/cli/internal/build.buildPatch={{ .Patch }} |
| 32 | + - -X github.com/databricks/cli/internal/build.buildPrerelease={{ .Prerelease }} |
| 33 | + - -X github.com/databricks/cli/internal/build.buildIsSnapshot={{ .IsSnapshot }} |
| 34 | + - -X github.com/databricks/cli/internal/build.buildTimestamp={{ .Timestamp }} |
| 35 | + |
| 36 | + goos: |
| 37 | + - linux |
| 38 | + - darwin |
| 39 | + goarch: |
| 40 | + - amd64 |
| 41 | + - arm64 |
| 42 | + binary: databricks |
| 43 | + |
| 44 | + - id: windows |
| 45 | + main: ./.github/release-test |
| 46 | + env: |
| 47 | + - CGO_ENABLED=0 |
| 48 | + mod_timestamp: '{{ .CommitTimestamp }}' |
| 49 | + flags: |
| 50 | + - -trimpath |
| 51 | + ldflags: *ldflags |
| 52 | + |
| 53 | + goos: |
| 54 | + - windows |
| 55 | + goarch: |
| 56 | + - amd64 |
| 57 | + - arm64 |
| 58 | + binary: databricks |
| 59 | + |
| 60 | + # Sign Windows binaries using jsign with Azure Key Vault. |
| 61 | + # When JSIGN_JAR is unset (e.g. snapshot builds), signing is skipped. |
| 62 | + # https://github.com/ebourg/jsign |
| 63 | + hooks: |
| 64 | + post: |
| 65 | + - bash -c 'test -z "${JSIGN_JAR}" && exit 0; java -jar "${JSIGN_JAR}" --storetype AZUREKEYVAULT --keystore deco-sign --storepass "${AZURE_VAULT_TOKEN}" --alias deco-sign --tsaurl http://timestamp.digicert.com "{{ .Path }}"' |
| 66 | + |
| 67 | +archives: |
| 68 | + - formats: ["zip", "tar.gz"] |
| 69 | + |
| 70 | + # Include version in archive only for release builds and not for snapshot builds. |
| 71 | + # Snapshot archives must have a stable file name such that the artifacts in the nightly |
| 72 | + # release are automatically overwritten. If the snapshot version is included in the |
| 73 | + # file name then additional logic to clean up older builds would be needed. |
| 74 | + name_template: 'databricks_cli_{{ if not .IsSnapshot }}{{ .Version }}_{{ end }}{{ .Os }}_{{ .Arch }}' |
| 75 | + |
| 76 | +checksum: |
| 77 | + name_template: 'databricks_cli_{{ .Version }}_SHA256SUMS' |
| 78 | + algorithm: sha256 |
| 79 | + |
| 80 | +snapshot: |
| 81 | + version_template: '{{ incpatch .Version }}-dev+{{ .ShortCommit }}' |
| 82 | + |
| 83 | +changelog: |
| 84 | + sort: asc |
| 85 | + filters: |
| 86 | + exclude: |
| 87 | + - '^docs:' |
| 88 | + - '^test:' |
0 commit comments