-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (111 loc) · 2.81 KB
/
main.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: main
on:
push:
branches:
- '**'
tags-ignore:
- '*'
env:
go-version: stable
python-version: 3.x
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Lint
uses: pre-commit/[email protected]
with:
extra_args: --all-files
check-goreleaser-config:
name: Check goreleaser.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: check -f .goreleaser.yml
verify:
name: Verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Verify
run: make verify
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Test
run: make test
kindtest:
name: Kind test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: Setup kind
run: make setup-kind
- name: Run kindtest
run: make kindtest
dry-run:
name: Dry-run release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: anchore/sbom-action/[email protected]
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
- name: GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: --snapshot --skip=sign,publish --clean
- name: Test built containers
run: make container-structure-test
tag:
name: Tag release
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [lint, verify, check-goreleaser-config, test, kindtest, dry-run]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Tag release
run: |
TAG="v$(cat VERSION)"
git tag ${TAG}
git push origin ${TAG} || true