Repository navigation
133 lines (114 loc) · 4.72 KB
/
Copy pathbump.yaml
File metadata and controls
133 lines (114 loc) · 4.72 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
name: Bump
on:
push:
branches:
- 'release-**'
workflow_dispatch: # Manual workflow trigger
inputs:
branch:
required: true
description: "SO release branch"
jobs:
bump-so-version:
if: github.event.created || github.event_name == 'workflow_dispatch'
name: bump operator metadata
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
steps:
- name: Setup Golang
uses: openshift-knative/hack/actions/setup-go@main
- name: Install yq
run: |
go install github.com/mikefarah/yq/v3@latest
- name: Install OPM
run: |
go install github.com/operator-framework/operator-registry/cmd/opm@v1.47.0
- name: Checkout openshift-knative/serverless-operator
uses: actions/checkout@v6
with:
# Always checkout main, we don't support bumping for patch releases (for now)
ref: main
path: ./src/github.com/${{ github.repository }}
fetch-depth: 0
- name: Checkout openshift-knative/knative-istio-authz-chart
uses: actions/checkout@v6
with:
repository: 'openshift-knative/knative-istio-authz-chart'
path: ./src/github.com/openshift-knative/knative-istio-authz-chart
token: ${{ secrets.SERVERLESS_QE_ROBOT }}
fetch-depth: 0
- name: Set branch
if: github.event_name == 'workflow_dispatch'
run: |
echo "RELEASE_BRANCH=${{ inputs.branch }}" >> $GITHUB_ENV
- name: Set branch
if: github.event.created
run: |
echo "RELEASE_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Create branch
working-directory: ./src/github.com/openshift-knative/knative-istio-authz-chart
run: |
set -euo pipefail
# Check if target branch exists, otherwise create it starting from main
if git show-ref --quiet refs/heads/${RELEASE_BRANCH}; then
echo "${RELEASE_BRANCH} branch exists"
else
git checkout -b ${RELEASE_BRANCH} main
git push origin ${RELEASE_BRANCH}:${RELEASE_BRANCH}
git checkout main
fi
- name: Bump chart version
working-directory: ./src/github.com/${{ github.repository }}
run: go run hack/cmd/bumpistiochart/bumpistiochart.go --branch "${RELEASE_BRANCH}" --chart-metadata-path "${{ github.workspace }}/src/github.com/openshift-knative/knative-istio-authz-chart/Chart.yaml"
- name: Push new chart version
working-directory: ./src/github.com/openshift-knative/knative-istio-authz-chart
run: |
set -euo pipefail
git config --global user.email "serverless-support@redhat.com"
git config --global user.name "serverless-qe"
if [[ `git status --porcelain` ]]; then
# Commit changes
git --no-pager diff
git add Chart.yaml
git commit -m "Bump chart to ${RELEASE_BRANCH}"
git push origin main
else
echo "No changes detected for ${RELEASE_BRANCH} bump"
fi
- name: Bump SO
working-directory: ./src/github.com/${{ github.repository }}
run: go run hack/cmd/bumpso/bumpso.go --branch "${RELEASE_BRANCH}"
- name: Regenerate all generated files
working-directory: ./src/github.com/${{ github.repository }}
run: make generated-files
# Generate catalog only if not triggered by a pull request. Credentials are not available in pre-submit phase.
- name: Regenerate file-based catalog
working-directory: ./src/github.com/${{ github.repository }}
env:
REGISTRY_REDHAT_IO_USERNAME: ${{ secrets.REGISTRY_REDHAT_IO_USERNAME }}
REGISTRY_REDHAT_IO_PASSWORD: ${{ secrets.REGISTRY_REDHAT_IO_PASSWORD }}
run: make generate-catalog
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
path: ./src/github.com/${{ github.repository }}
branch: auto/bump-so-version-${{ github.ref_name }}
title: "[main] Bump Serverless Operator version after ${{ github.ref_name }} cut"
commit-message: "Bump SO version"
delete-branch: true
body: |
Bump SO version + run `make generated-files`
- name: Trigger Konflux and CI discovery
if: ${{ always() }}
uses: actions/github-script@v9
with:
github-token: ${{ secrets.SERVERLESS_QE_ROBOT }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'hack',
workflow_id: 'release-discover-branches.yaml',
ref: 'main',
})