-
Notifications
You must be signed in to change notification settings - Fork 69
106 lines (91 loc) · 3.65 KB
/
bump.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
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: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Checkout openshift-knative/serverless-operator
uses: actions/checkout@v4
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@v4
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 "[email protected]"
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
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
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`