-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (71 loc) · 2.15 KB
/
build.yaml
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
name: build
on:
pull_request:
branches:
- "*"
paths-ignore:
- config/helm-chart/**
push:
branches:
- main
tags:
- "v*"
paths-ignore:
- config/helm-chart/**
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
permissions:
checks: write
contents: write
packages: write
statuses: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/[email protected]
- name: createVersion
run: |
GIT_VERSION=$(git describe --tag --always --match "v*")
echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_ENV
echo "VERSION=$(echo ${GIT_VERSION} | sed s/^v//)" >> $GITHUB_ENV
- name: setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/[email protected]
with:
args: --timeout=10m
- name: run tests
run: |
make test
- uses: codecov/codecov-action@v4
- name: 'Login to GitHub Container Registry'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
run: |
make docker-buildx VERSION=${{ env.VERSION }}
- name: bundle
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
run: |
make bundle bundle-build bundle-push VERSION=${{ env.VERSION }}
- name: catalog
if: startsWith(github.ref, 'refs/tags/v')
run: |
make update-catalog-template catalog-build catalog-push VERSION=${{ env.VERSION }}
# re-tag as alpha, so that we can stick to a single channel
echo re-tagging
make catalog-retag VERSION=${{ env.VERSION }}
- name: createRelease
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false