-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (43 loc) · 1.24 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: CI
env:
GO_VERSION: 1.20.x
on:
push:
workflow_dispatch:
jobs:
release:
# runs-on: ubuntu-latest
runs-on: self-hosted
# if: startsWith(github.ref, 'ref/tags/v')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get go version
id: go-version
run: echo "::set-output name=version::$(go env GOVERSION)"
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ steps.go-version.outputs.version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ runner.os }}-go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}