Update build image to use new k8s pkg repo (#2568) #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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@v4 | |
with: | |
go-version: 1.20.x | |
- name: Install prerequisites | |
env: | |
YQ_VERSION: 3.4.0 | |
run: | | |
sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/bin/yq | |
sudo chmod +x /usr/bin/yq | |
sudo mv /usr/bin/yq /usr/local/bin/yq | |
- 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 | |
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: Bump chart version | |
working-directory: ./src/github.com/openshift-knative/knative-istio-authz-chart | |
run: go run hack/cmd/bumpistiochart/bumpistiochart.go --branch "${RELEASE_BRANCH}" | |
- name: Create branch | |
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 "OpenShift Serverless" | |
git config --global user.password "${{ secrets.SERVERLESS_QE_ROBOT }}" | |
# 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: Set chart version | |
run: | | |
chart_version=${RELEASE_BRANCH/release-/} # remove `release-` prefix | |
# This temporary use the current chart version because using the next version might fail | |
# since it's not published yet, see `mesh-auth-policies.sh` as part of the | |
# `make generated-files` command | |
echo "ISTIO_CHART_VERSION=${chart_version}.0" >> $GITHUB_ENV | |
- 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@v5 | |
with: | |
path: ./src/github.com/${{ github.repository }} | |
branch: auto/bump-so-version-${{ github.ref_name }} | |
title: "[${{ github.ref_name }}] Bump Serverless Operator version" | |
commit-message: "Bump SO version" | |
delete-branch: true | |
body: | | |
Bump SO version + run `make generated-files` |