-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (79 loc) · 2.17 KB
/
release.yml
File metadata and controls
95 lines (79 loc) · 2.17 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Run tests
run: gotestsum --format pkgname -- ./... -race
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
args: --timeout=5m
goreleaser:
needs: [test, lint]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # required for cosign keyless signing via Sigstore/Fulcio
steps:
- name: Mint token for homebrew-tap
id: homebrew-tap-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.HOMEBREW_TAP_APP_ID }}
private-key: ${{ secrets.HOMEBREW_TAP_APP_PRIVATE_KEY }}
owner: gleanwork
repositories: homebrew-tap
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up mise
uses: jdx/mise-action@v4
with:
cache: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Install syft (for SBOM generation)
uses: anchore/sbom-action/download-syft@v0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.homebrew-tap-token.outputs.token }}