forked from rhobs/observability-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 3.36 KB
/
Copy pathrelease.yaml
File metadata and controls
100 lines (88 loc) · 3.36 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
96
97
98
99
100
# Publishes a development release on every push to main (except release commits).
# RC and stable releases are handled by release-branch.yaml and olm-stable.yaml.
name: Release
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
e2e-tests-olm:
if: "!startsWith(github.event.head_commit.message, 'ci(bot):')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: e2e tests through OLM
uses: ./.github/e2e-tests-olm
publish-olm-development:
if: "!startsWith(github.event.head_commit.message, 'chore(release):') && !startsWith(github.event.head_commit.message, 'ci(bot):')"
runs-on: ubuntu-latest
environment: quay
needs:
- e2e-tests-olm
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# Bumping the version in the next step will also run code generation scripts
# that depend on controller-gen.
# Therefore, we first need to setup Go so that we can install the
# controller-gen binary.
- name: Setup Go environment
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
check-latest: true
- name: Set version
id: version
run: |
npx standard-version --skip.commit --skip.tag --skip.changelog
version="$(cat VERSION)-$(date +%y%m%d%H%M%S)"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Publish OLM
uses: ./.github/olm-publish
env:
IMG_BASE: ${{ vars.IMG_BASE }}
VERSION: ${{ steps.version.outputs.version }}
CHANNELS: development
RELEASE_SHA: ${GITHUB_SHA}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
- name: Open catalog PR
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name rhobs-release-bot
git config user.email release-bot@monitoring.rhobs.io
PR_BRANCH="ci/olm-catalog-development"
git checkout -b "$PR_BRANCH"
git add bundle/ olm/index-template.yaml
git commit -m "ci(bot): update OLM development catalog to ${{ steps.version.outputs.version }}"
git push --force origin "$PR_BRANCH"
# Create the PR if it does not exist yet; subsequent pushes update it via force-push.
existing=$(gh pr list --head "$PR_BRANCH" --base main --json number --jq '.[0].number')
if [ -z "$existing" ]; then
gh pr create \
--base main \
--head "$PR_BRANCH" \
--title "ci: update OLM development catalog" \
--body "Automated catalog update for the development channel. This PR is force-updated on every push to main."
fi
- name: Publish Package
uses: ./.github/package-operator-publish
env:
IMG_BASE: ${{ vars.IMG_BASE }}
VERSION: ${{ steps.version.outputs.version }}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}
- name: Publish test harness
uses: ./.github/osd-test-harness-publish
env:
IMG_BASE: ${{ vars.IMG_BASE }}
VERSION: ${{ steps.version.outputs.version }}
with:
quay_login: ${{ secrets.QUAY_LOGIN }}
quay_token: ${{ secrets.QUAY_TOKEN }}