-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathaction.yaml
More file actions
95 lines (80 loc) · 2.51 KB
/
action.yaml
File metadata and controls
95 lines (80 loc) · 2.51 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: 'Publish to OLM'
description: 'Publishes the operator to OLM'
inputs:
quay_login:
description: "Quay login"
required: true
quay_token:
description: "Quay token"
required: true
runs:
using: composite
steps:
- name: Check Go version
id: go-version
shell: bash
run: |
go version
- name: Setup Go environment
uses: actions/setup-go@v5
if: steps.go-version.outcome == 'failure'
with:
go-version-file: 'go.mod'
check-latest: true
- name: Install tools
uses: ./.github/tools-cache
- name: Registry Login
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ inputs.quay_login }}
password: ${{ inputs.quay_token }}
- name: Create new integration branch
shell: bash
# Creating a branch here in order to avoid commiting to our local main
# branch further down in this action. In some make targets we use main's sha
# and by creating a branch here we can just assume local main is the same as
# remote main.
run: |
# Discard any uncommitted changes from previous steps (e.g., standard-version)
git reset --hard HEAD
git clean -fd
git checkout -b olm-publish-action-scratch
- name: Fetch olm-catalog branch
shell: bash
run: git fetch origin olm-catalog
- name: Git merge olm-catalog branch
shell: bash
run: |
git config user.name rhobs-release-bot
git config user.email release-bot@monitoring.rhobs.io
# NOTE: uses strategy-option=ours as bundle created for a release using
# make initiate-release conflicts with the previous bundle created for
# development branch, so the version in main takes precedence over the
# one in olm-catalog branch
git merge -Xours origin/olm-catalog -m "ci: merge olm-catalog branch"
- name: Build Operator Image
shell: bash
run: make operator-image
- name: Publish Operator
shell: bash
run: make operator-push
- name: Build Bundle Image
shell: bash
run: make bundle-image
- name: Publish Bundle
shell: bash
run: make bundle-push
- name: Build Catalog Image
shell: bash
run: |
make catalog-image
# NOTE: add a commit only if the catalog can built sucessfully
git add bundle/ olm/
git commit -m "ci(bot): update catalog image"
- name: Publish catalog image
shell: bash
run: |
make catalog-push
# update olm-catalog only if catalog could be successfully published
git push origin HEAD:olm-catalog