-
-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (51 loc) · 1.38 KB
/
release.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
name: release
on:
push:
tags:
- '*'
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
jobs:
test:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
- name: Install Ginkgo v2
run: go install github.com/onsi/ginkgo/v2/ginkgo@latest
- name: Test
run: ginkgo ./...
release:
needs: [test]
env:
GO111MODULE: on
name: Release
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version: 1.22.x
- name: Install syft
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Install cosign
uses: sigstore/[email protected]
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}