mirror of https://github.com/databricks/cli.git
Work on release actions (#153)
* Include Go version in cache key * Store build artifacts by operating systems
This commit is contained in:
parent
f5cb9e06a9
commit
f3112d90ad
|
@ -18,6 +18,7 @@ jobs:
|
||||||
run: git fetch --prune --unshallow
|
run: git fetch --prune --unshallow
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
|
id: go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18.8
|
go-version: 1.18.8
|
||||||
|
@ -36,7 +37,7 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
${{ steps.cache.outputs.GOMODCACHE }}
|
${{ steps.cache.outputs.GOMODCACHE }}
|
||||||
${{ steps.cache.outputs.GOCACHE }}
|
${{ steps.cache.outputs.GOCACHE }}
|
||||||
key: release-${{ runner.os }}-go-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
key: release-${{ runner.os }}-go-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v4
|
uses: goreleaser/goreleaser-action@v4
|
||||||
|
@ -44,8 +45,23 @@ jobs:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --snapshot
|
args: release --snapshot
|
||||||
|
|
||||||
- name: Upload assets
|
- name: Upload macOS binaries
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: bricks
|
name: bricks_darwin_snapshot
|
||||||
path: dist/*.zip
|
path: |
|
||||||
|
dist/bricks_darwin_*
|
||||||
|
|
||||||
|
- name: Upload Linux binaries
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bricks_linux_snapshot
|
||||||
|
path: |
|
||||||
|
dist/bricks_linux_*
|
||||||
|
|
||||||
|
- name: Upload Windows binaries
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bricks_windows_snapshot
|
||||||
|
path: |
|
||||||
|
dist/bricks_windows_*
|
||||||
|
|
|
@ -18,6 +18,7 @@ jobs:
|
||||||
run: git fetch --prune --unshallow
|
run: git fetch --prune --unshallow
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
|
id: go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18.8
|
go-version: 1.18.8
|
||||||
|
@ -28,18 +29,18 @@ jobs:
|
||||||
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||||
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Note: use custom caching because goreleaser performs a cross platform build
|
# Note: use custom caching because below performs a cross platform build
|
||||||
# and therefore we cannot share a cache with the test builds.
|
# through goreleaser and don't want to share a cache with the test builds.
|
||||||
- name: Setup caching
|
- name: Setup caching
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ steps.cache.outputs.GOMODCACHE }}
|
${{ steps.cache.outputs.GOMODCACHE }}
|
||||||
${{ steps.cache.outputs.GOCACHE }}
|
${{ steps.cache.outputs.GOCACHE }}
|
||||||
key: release-${{ runner.os }}-go-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
key: release-${{ runner.os }}-go-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v3.1.0
|
uses: goreleaser/goreleaser-action@v4
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
|
Loading…
Reference in New Issue