2022-05-13 15:43:54 +00:00
|
|
|
name: release
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-09-08 12:13:43 +00:00
|
|
|
workflow_dispatch:
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
jobs:
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-09-08 13:12:26 +00:00
|
|
|
- name: Checkout repository and submodules
|
2022-12-12 15:51:27 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
2022-12-12 15:51:27 +00:00
|
|
|
|
2022-09-08 09:21:00 +00:00
|
|
|
- name: Setup Go
|
2022-12-22 10:01:50 +00:00
|
|
|
id: go
|
2022-09-08 09:21:00 +00:00
|
|
|
uses: actions/setup-go@v3
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
2023-02-03 14:13:29 +00:00
|
|
|
go-version: 1.19.5
|
2022-12-22 09:25:24 +00:00
|
|
|
|
|
|
|
- name: Locate cache paths
|
|
|
|
id: cache
|
|
|
|
run: |
|
|
|
|
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-12-22 10:01:50 +00:00
|
|
|
# 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.
|
2022-12-22 09:25:24 +00:00
|
|
|
- name: Setup caching
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{ steps.cache.outputs.GOMODCACHE }}
|
|
|
|
${{ steps.cache.outputs.GOCACHE }}
|
2022-12-22 10:01:50 +00:00
|
|
|
key: release-${{ runner.os }}-go-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', '.goreleaser.yaml') }}
|
2022-12-12 15:51:27 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
- name: Run GoReleaser
|
2022-12-22 10:01:50 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v4
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
|
|
|
version: latest
|
2023-04-20 09:59:34 +00:00
|
|
|
args: release
|
2022-05-13 15:43:54 +00:00
|
|
|
env:
|
2022-09-08 12:13:43 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|