-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (59 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (59 loc) · 1.71 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# .github/workflows/release.yml
#
# Triggered by pushing a v* tag (e.g. v0.2.0). Builds multi-arch
# binaries, attaches them to a GitHub release, and opens a PR on
# the homebrew-tap repo if one is configured.
#
# To cut a release:
# git tag v0.2.0
# git push origin v0.2.0
# The release.yml workflow will run; the .goreleaser.yaml config
# drives the rest.
name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Check go mod tidy
run: |
go mod tidy
test -z "$(git diff -- go.mod go.sum)" || (echo "go.mod/go.sum are stale." && exit 1)
- name: Sanity build
run: go build ./...
- name: Check formatting
run: test -z "$(go fmt ./...)" || (echo "Not formatted." && exit 1)
- name: Check go mod tidy
run: |
go mod tidy
test -z "$(git diff -- go.mod go.sum)" || (echo "go.mod/go.sum are stale." && exit 1)
- name: Sanity test
run: go test ./... -count=1
- name: Run go vet
run: go vet ./...
- name: Run staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Install goreleaser
run: |
go install github.com/goreleaser/goreleaser/v2@latest
- name: Run goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goreleaser release --clean