Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate CI supports patch versions #2641

Merged
merged 2 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not call it with:

go run github.com/openshift-knative/hack/cmd/prowcopy

(or with @main if we don't keep track of the github.com/openshift-knative/hack/cmd/prowcopy in go.mod)

Copy link
Member Author

@pierDipi pierDipi May 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as before, I don't think it's related to this change and can be "improved" as a follow up?


- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have yq installed at this point?
Just wondering, because here we "download" it:

if [[ "$(GOFLAGS='' go run github.com/mikefarah/yq/v3@latest read "$csv" spec.replaces)" == "" || \

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a step

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🎉


- 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