mirror of https://github.com/databricks/cli.git
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository and submodules
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.18.8
|
|
|
|
- name: Locate cache paths
|
|
id: cache
|
|
run: |
|
|
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
|
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
# Note: use custom caching because goreleaser performs a cross platform build
|
|
# and therefore we cannot share a cache with the test builds.
|
|
- name: Setup caching
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
${{ steps.cache.outputs.GOMODCACHE }}
|
|
${{ steps.cache.outputs.GOCACHE }}
|
|
key: release-${{ runner.os }}-go-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v3.1.0
|
|
with:
|
|
version: latest
|
|
args: release --rm-dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|