Skip to content

Commit 59564c6

Browse files
committed
Use dummy binary and custom runners for fast iteration
- Build a trivial main.go instead of the full CLI for speed - Use custom Windows runner (windows-server-latest-large) - Add JFrog OIDC setup on both runners - Add id-token: write permission for OIDC Co-authored-by: Isaac
1 parent 7774501 commit 59564c6

4 files changed

Lines changed: 90 additions & 6 deletions

File tree

.github/release-test/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Println("release-test")
7+
}

.github/workflows/release-test.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ on:
99

1010
jobs:
1111
# Build Unix (Linux/macOS) binaries in snapshot mode.
12-
# Skips Docker images and GitHub release publishing.
12+
# Uses a dummy binary for fast iteration on the workflow itself.
1313
goreleaser-unix:
1414
runs-on:
1515
group: databricks-deco-testing-runner-group
1616
labels: ubuntu-latest-deco
1717

18+
permissions:
19+
id-token: write
20+
contents: read
21+
1822
steps:
1923
- name: Checkout repository and submodules
2024
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -35,7 +39,7 @@ jobs:
3539
go-version-file: go.mod
3640
cache-dependency-path: |
3741
go.sum
38-
.goreleaser-unix.yaml
42+
.goreleaser-test-unix.yaml
3943
4044
- name: Configure Go module proxy via JFrog
4145
run: jf goc --repo-resolve=db-golang
@@ -47,7 +51,7 @@ jobs:
4751
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
4852
with:
4953
version: ~> v2
50-
args: release -f .goreleaser-unix.yaml --snapshot --skip docker
54+
args: release -f .goreleaser-test-unix.yaml --snapshot
5155
env:
5256
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5357

@@ -64,7 +68,13 @@ jobs:
6468
# Uses AzureSignTool with Azure Key Vault for code signing.
6569
goreleaser-windows:
6670
environment: sign
67-
runs-on: windows-latest
71+
runs-on:
72+
group: databricks-protected-runner-group-large
73+
labels: windows-server-latest-large
74+
75+
permissions:
76+
id-token: write
77+
contents: read
6878

6979
steps:
7080
- name: Checkout repository and submodules
@@ -73,13 +83,24 @@ jobs:
7383
fetch-depth: 0
7484
fetch-tags: true
7585

86+
- name: Setup JFrog CLI with OIDC
87+
uses: jfrog/setup-jfrog-cli@279b1f629f43dd5bc658d8361ac4802a7ef8d2d5 # v4.9.1
88+
env:
89+
JF_URL: https://databricks.jfrog.io
90+
with:
91+
oidc-provider-name: github-actions
92+
7693
- name: Setup Go
7794
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
7895
with:
7996
go-version-file: go.mod
8097
cache-dependency-path: |
8198
go.sum
82-
.goreleaser-windows.yaml
99+
.goreleaser-test-windows.yaml
100+
101+
- name: Configure Go module proxy via JFrog
102+
shell: bash
103+
run: jf goc --repo-resolve=db-golang
83104

84105
- name: Hide snapshot tag to outsmart GoReleaser
85106
run: git tag -d snapshot || true
@@ -109,7 +130,7 @@ jobs:
109130
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
110131
with:
111132
version: ~> v2
112-
args: release -f .goreleaser-windows.yaml --snapshot
133+
args: release -f .goreleaser-test-windows.yaml --snapshot
113134
env:
114135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115136
AZURE_TENANT_ID: ${{ secrets.DECO_SIGN_AZURE_TENANT_ID }}

.goreleaser-test-unix.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
3+
builds:
4+
- main: ./.github/release-test
5+
env:
6+
- CGO_ENABLED=0
7+
flags:
8+
- -trimpath
9+
goos:
10+
- linux
11+
- darwin
12+
goarch:
13+
- amd64
14+
- arm64
15+
binary: databricks
16+
17+
archives:
18+
- formats: ["zip", "tar.gz"]
19+
name_template: 'databricks_cli_{{ if not .IsSnapshot }}{{ .Version }}_{{ end }}{{ .Os }}_{{ .Arch }}'
20+
21+
checksum:
22+
name_template: 'databricks_cli_{{ .Version }}_SHA256SUMS_unix'
23+
algorithm: sha256
24+
25+
snapshot:
26+
version_template: '{{ incpatch .Version }}-dev+{{ .ShortCommit }}'

.goreleaser-test-windows.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
3+
builds:
4+
- id: cli
5+
main: ./.github/release-test
6+
env:
7+
- CGO_ENABLED=0
8+
flags:
9+
- -trimpath
10+
goos:
11+
- windows
12+
goarch:
13+
- amd64
14+
- arm64
15+
binary: databricks
16+
17+
hooks:
18+
post:
19+
- azuresigntool sign --azure-key-vault-url "https://deco-sign.vault.azure.net/" --azure-key-vault-client-id "{{ .Env.AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "{{ .Env.AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "{{ .Env.AZURE_TENANT_ID }}" --azure-key-vault-certificate "deco-sign" --file-digest sha256 --timestamp-rfc3161 http://timestamp.digicert.com --timestamp-digest sha256 "{{ .Path }}"
20+
21+
archives:
22+
- formats: ["zip"]
23+
name_template: 'databricks_cli_{{ if not .IsSnapshot }}{{ .Version }}_{{ end }}{{ .Os }}_{{ .Arch }}'
24+
25+
checksum:
26+
name_template: 'databricks_cli_{{ .Version }}_SHA256SUMS_windows'
27+
algorithm: sha256
28+
29+
snapshot:
30+
version_template: '{{ incpatch .Version }}-dev+{{ .ShortCommit }}'

0 commit comments

Comments
 (0)