-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.03 KB
/
build.yml
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
---
name: build
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
packages: write # if pushing docker images
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Need a PAT so that `make release-tag` will trigger the release workflow.
# See: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ github.ref_name == 'main' && secrets.GH_PAT || secrets.GITHUB_TOKEN }}
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/golangci-lint
~/.npm
~/go/bin
/home/linuxbrew/.linuxbrew
key: ${{ runner.os }}-dependencies
- name: Set up Homebrew
uses: homebrew/actions/setup-homebrew@master
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install dependencies
run: make setup
- name: Build
run: make build
- name: Lint
run: make lint
- name: Test
run: make test
- name: Coverage
uses: codecov/codecov-action@v5
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
if: github.ref_name == 'main'
with:
gpg_private_key: ${{ secrets.GH_COMMIT_SIGNING_KEY }}
passphrase: ${{ secrets.GH_COMMIT_SIGNING_PASS }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
git_push_gpgsign: false
- name: Create release tag
if: github.ref_name == 'main'
run: make release-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}