databricks-cli/.github/workflows/release.yml

54 lines
1.3 KiB
YAML
Raw Normal View History

name: release
on:
push:
tags:
- "v*"
2022-09-08 12:13:43 +00:00
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
2022-09-08 13:12:26 +00:00
- name: Checkout repository and submodules
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Setup Go
id: go
uses: actions/setup-go@v3
with:
2023-02-03 14:13:29 +00:00
go-version: 1.19.5
- 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 below performs a cross platform build
# through goreleaser and don't want to 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-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release
env:
2022-09-08 12:13:43 +00:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
uses: ./.github/workflows/publish-latest.yml
needs: goreleaser
secrets: inherit