Run make generated-files (#3234) #160
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: openshift-knative/hack/actions/setup-go@main | |
- name: Install OPM | |
run: | | |
go install github.com/operator-framework/operator-registry/cmd/[email protected] | |
- 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 | |
# 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@v7 | |
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@v7 | |
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', | |
}) |