Skip to content

Commit

Permalink
Generate CI supports patch versions (#2641)
Browse files Browse the repository at this point in the history
* Generate CI supports patch versions

When creating a new branch or updating a patch version for a
release branch, we will run the automation to regenarate the
CI config and update the promotion tag according to `project.yaml`
version

Depends on openshift-knative/hack#153

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Install yq

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi committed May 10, 2024
1 parent 7d60f86 commit 2cc132d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release-generate-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
branch:
required: true
description: "SO branch"
tag:
required: true
description: "Promotion tag"

jobs:
generate-ci:
Expand All @@ -29,6 +32,10 @@ jobs:
with:
path: ./src/github.com/openshift-knative/serverless-operator

- name: Install yq
run: |
go install github.com/mikefarah/yq/v3@latest
- name: Checkout openshift-knative/hack
uses: actions/checkout@v4
with:
Expand All @@ -51,12 +58,17 @@ jobs:
- name: Generate CI (on workflow dispatch)
if: github.event_name == 'workflow_dispatch'
working-directory: ./src/github.com/openshift-knative/hack
run: go run ./cmd/prowcopy --branch ${{ inputs.branch }} --tag ${{ inputs.branch }} --config config/serverless-operator.yaml
run: go run ./cmd/prowcopy --branch ${{ inputs.branch }} --tag ${{ inputs.tag }} --config config/serverless-operator.yaml

- name: Generate CI (on branch created)
if: github.event.created
working-directory: ./src/github.com/openshift-knative/hack
run: go run ./cmd/prowcopy --branch ${{ github.ref_name }} --tag ${{ github.ref_name }} --config config/serverless-operator.yaml
run: go run ./cmd/prowcopy --branch ${{ github.ref_name }} --tag "release-$(yq read ../serverless-operator/olm-catalog/serverless-operator/project.yaml 'project.version') --config config/serverless-operator.yaml

- name: Generate CI (on push)
if: github.event.created == false
working-directory: ./src/github.com/openshift-knative/hack
run: go run ./cmd/prowcopy --from-branch ${{ github.ref_name }} --branch ${{ github.ref_name }} --tag "release-$(yq read ../serverless-operator/olm-catalog/serverless-operator/project.yaml 'project.version') --config config/serverless-operator.yaml

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand Down

0 comments on commit 2cc132d

Please sign in to comment.