Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release-finalize-rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Action - Finalize RC
run-name: Finalize RC for version ${{ github.event.inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23"
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
finalize-rc:
uses: ./.github/workflows/release-manager.yaml
with:
action: finalize-rc
version: ${{ github.event.inputs.version }}
secrets:
OPENSHIFT_PIPELINES_ROBOT: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
25 changes: 20 additions & 5 deletions .github/workflows/release-manager.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
name: Automated Release Actions
run-name: Execute ${{ github.event.inputs.action || 'update-upstream-versions' }} for version ${{ github.event.inputs.version || 'next' }}
run-name: Execute ${{ inputs.action || 'update-upstream-versions' }} for version ${{ inputs.version || 'next' }}

on:
schedule:
- cron: "0 0 * * *" # At every day at 00
workflow_call:
inputs:
action:
description: 'Select Action (see README for details)'
required: true
type: string
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23", "next"
required: true
type: string
secrets:
OPENSHIFT_PIPELINES_ROBOT:
required: true
workflow_dispatch:
inputs:
action:
Expand All @@ -13,22 +25,25 @@ on:
options:
- new-release
- new-patch
- finalize-rc
- update-upstream-versions
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23", "next"
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
run-release:
runs-on: ubuntu-latest
env:
# NOTE: in case of update, the defaults here are also specified in the run-name
ACTION: ${{ github.event.inputs.action || 'update-upstream-versions' }}
VERSION: ${{ github.event.inputs.version || 'next' }}
ACTION: ${{ inputs.action || 'update-upstream-versions' }}
VERSION: ${{ inputs.version || 'next' }}
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/release-new-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Action - New Patch
run-name: New Patch for version ${{ github.event.inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23"
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
new-patch:
uses: ./.github/workflows/release-manager.yaml
with:
action: new-patch
version: ${{ github.event.inputs.version }}
secrets:
OPENSHIFT_PIPELINES_ROBOT: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
24 changes: 24 additions & 0 deletions .github/workflows/release-new-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Action - New Release
run-name: New Release for version ${{ github.event.inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23"
required: true
type: string

permissions:
contents: write
pull-requests: write

jobs:
new-release:
uses: ./.github/workflows/release-manager.yaml
with:
action: new-release
version: ${{ github.event.inputs.version }}
secrets:
OPENSHIFT_PIPELINES_ROBOT: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
73 changes: 73 additions & 0 deletions .github/workflows/release-update-upstream-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release Action - Update Upstream Versions
run-name: Update Upstream Versions for ${{ github.event.inputs.version || 'next and RC versions' }}

on:
schedule:
- cron: "0 0 * * *" # At every day at 00
workflow_dispatch:
inputs:
version:
description: |
Downstream Release Version. Eg: "1.22", "1.23", "next"
required: false
type: string
default: next

permissions:
contents: write
pull-requests: write

jobs:
gather-versions-for-auto-upgrade:
runs-on: ubuntu-latest
outputs:
auto-upgrade-versions: ${{steps.gather-versions.outputs.auto-upgrade-versions}}
steps:
- uses: actions/checkout@v6
- name: Generate upgrade matrix
id: gather-versions
run: |
#!/bin/bash
VERSION="${{ github.event.inputs.version }}"

# If workflow_dispatch, use the input version
if [[ -n "${VERSION}" ]]; then
echo "auto-upgrade-versions=[\"$VERSION\"]" >> $GITHUB_OUTPUT
exit 0
fi

# If scheduled, gather versions from release files
VERSIONS=()

for file in config/downstream/releases/*.yaml; do
# Get release-tag from the file
RELEASE_TAG=$(yq eval '.release-tag' "$file")

# Check if release-tag is "next" or ends with -RC-\d+
if [[ "$RELEASE_TAG" == "next" ]] || [[ "$RELEASE_TAG" =~ -RC-[0-9]+$ ]]; then
# Get the version field, or derive from filename
VERSION=$(yq eval '.version' "$file")

if [[ "$VERSION" == "null" ]]; then
VERSION=$(basename --suffix .yaml "$file")
fi

VERSIONS+=("\"$VERSION\"")
fi
done

JSON_ARRAY=$(IFS=,; echo "[${VERSIONS[*]}]")
echo "auto-upgrade-versions=${JSON_ARRAY}" >> $GITHUB_OUTPUT


update-upstream-versions:
needs: gather-versions-for-auto-upgrade
strategy:
matrix:
version: ${{ fromJSON(needs.gather-versions-for-auto-upgrade.outputs.auto-upgrade-versions) }}
uses: ./.github/workflows/release-manager.yaml
with:
action: update-upstream-versions
version: ${{ matrix.version }}
secrets:
OPENSHIFT_PIPELINES_ROBOT: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@ Contains a bunch of hack used for `openshift-pipelines` repositories.
- Generate prow configuration (and sync in `openshift/release`)
- For `task*` repositories.
- Generate github workflows "matrix" for `task*` repositories.
- Generate and store the configuration for Konflux resources and automation (build PipelineRuns, ReleasePlans, etc)

---
## Adding New Release
Now release can be added just a click of button.
- From Action Menu on github select action "Automated Release Actions"
- Run Workflow
- Select appropriate Branch
- Action : new-release
- Version: Provide the version you want to add e.g 1.23
- Run Workflow
- This workflow will add new PR to hack repo with updated version configuration.
Now release can be added just a click of button.
- From Action Menu on github select action "Release Action - New Release"
- Run Workflow with the following inputs:
- Select `main` branch
- Version: Provide the version you want to add e.g `1.23` (will create the tag `1.23.0-RC-1`)
- This workflow will add new PR to hack repo with updated version configuration for the Release Candidate.
- Verify the PR and merge
- Repeat the above for subsequent Release Candidate builds
- When ready to create the final pre-stage release, from the Action Menu on Github run select the action "Release Action - Finalize RC"
- Run the workflow with the following inputs:
- Select `main` branch
- Version: Provide the version you want to finalize (e.g. `1.23`)
- This workflow will add new PR to the hack repo that removes the RC suffix from the release's version.
- Verify the PR and merge

After PR is merged then new workflow will be triggered which will generate release configuration in all the Repos.
After the initial PR is merged then new workflow will be triggered which will generate release configuration in all the Repos.
The initial release will be configured as a Release Candidate with a version like 1.23.0-RC-1.

---
## Adding New Patch
Expand Down Expand Up @@ -55,7 +63,7 @@ versions for unreleased versions which you can do by this workflow.
After PR is merged then new workflow will be triggered which will generate release configuration in all the Repos.

---


TODO for automation:
(waveywaves)
Expand Down
4 changes: 1 addition & 3 deletions cmd/konflux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ func main() {
versionConfig.Version.ImagePrefix = config.ImagePrefix + versionConfig.Version.ImagePrefix
versionConfig.Version.Version = *version
if versionConfig.Version.Version == "next" || versionConfig.Version.Version == "nightly" {
versionConfig.Version.PatchVersion = versionConfig.Version.PatchVersion
} else if !strings.HasPrefix(versionConfig.Version.PatchVersion, "v") {
versionConfig.Version.PatchVersion = "v" + versionConfig.Version.PatchVersion
versionConfig.Version.ReleaseTag = *version
}
}

Expand Down
4 changes: 2 additions & 2 deletions component-monitor/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def load_release_configs():
version = str(data.get("version", version_key))
releases[version_key] = {
"version": version,
"patch_version": str(data.get("patch-version", "")),
"release_tag": str(data.get("release-tag", "")),
"code_freeze": data.get("code-freeze", False),
"branches": data.get("branches", {}),
}
Expand Down Expand Up @@ -883,7 +883,7 @@ def main():

result["versions"][version_key] = {
"version": version,
"patch_version": release["patch_version"],
"release_tag": release["release_tag"],
"code_freeze": release["code_freeze"],
"comp_yaml_url": comp_yaml_url,
"components": components_data,
Expand Down
4 changes: 2 additions & 2 deletions component-monitor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ <h1>Component Monitor</h1>
document.getElementById("components-label").style.display = "block";
document.getElementById("version-info").innerHTML = `
<div><span>Version:</span> <strong>${versionData.version}</strong></div>
<div><span>Patch:</span> <strong>${versionData.patch_version || "-"}</strong></div>
<div><span>Patch:</span> <strong>${versionData.release_tag || "-"}</strong></div>
<div><span>Code Freeze:</span>
<span class="code-freeze-badge ${versionData.code_freeze ? "active" : "inactive"}">
${versionData.code_freeze ? "Active" : "Inactive"}
Expand Down Expand Up @@ -877,7 +877,7 @@ <h1>Component Monitor</h1>
btn.appendChild(dot);

const label = document.createElement("span");
const suffix = v.patch_version && v.patch_version !== v.version ? ` (${v.patch_version})` : "";
const suffix = v.release_tag&& v.release_tag!== v.version ? ` (${v.release_tag})` : "";
label.textContent = v.version + suffix;
btn.appendChild(label);

Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/1.15.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "1.15"
image-suffix: -rhel8
patch-version: 1.15.5
release-tag: 1.15.5
code-freeze: false
docker-file-options:
args:
Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/1.20.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "1.20"
image-suffix: -rhel9
patch-version: 1.20.5
release-tag: 1.20.5
code-freeze: true
branches:
git-init:
Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/1.21.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1.21
patch-version: 1.21.2
release-tag: 1.21.2
image-suffix: "-rhel9"
code-freeze: false
branches:
Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/1.22.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1.22
patch-version: 1.22.2
release-tag: 1.22.2
image-suffix: "-rhel9"
code-freeze: false
branches:
Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/1.23.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1.23
patch-version: 1.23.0
release-tag: 1.23.0
image-suffix: "-rhel9"
code-freeze: false
branches:
Expand Down
2 changes: 1 addition & 1 deletion config/downstream/releases/next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ branches:
upstream: release-v0.1.x
multicluster-proxy-aae:
upstream: release-v0.1.x
patch-version: next
release-tag: next
2 changes: 1 addition & 1 deletion config/downstream/releases/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: nightly
patch-version: latest
release-tag: latest
image-suffix: "-rhel9"
code-freeze: false
docker-file-options:
Expand Down
2 changes: 1 addition & 1 deletion config/upstream/konflux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ applications:
- multicluster-proxy-aae
versions:
- version: 0.1
patch-version: v0.1.1
release-tag: v0.1.1
image-suffix: "-rhel9"
2 changes: 1 addition & 1 deletion config/upstream/multicluster-proxy-aae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ applications:
- multicluster-proxy-aae
versions:
- version: 0.1
patch-version: v0.1.1
release-tag: v0.1.1
image-suffix: "-rhel9"
2 changes: 1 addition & 1 deletion config/upstream/releases/0.1.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version: 0.1
patch-version: v0.1.1
release-tag: v0.1.1
image-suffix: "-rhel9"
2 changes: 1 addition & 1 deletion config/upstream/releases/0.2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version: 0.2
patch-version: 0.2.0
release-tag: 0.2.0
image-suffix: "-rhel9"
2 changes: 1 addition & 1 deletion config/upstream/releases/0.3.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version: 0.3
patch-version: v0.3.0
release-tag: v0.3.0
2 changes: 1 addition & 1 deletion config/upstream/syncer-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ applications:
- syncer-service
versions:
- version: 0.1
patch-version: v0.1.1
release-tag: v0.1.1
image-suffix: "-rhel9"
2 changes: 1 addition & 1 deletion config/upstream/tekton-kueue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ applications:
- tekton-kueue
versions:
- version: 0.3
patch-version: v0.3.1
release-tag: v0.3.1
image-suffix: "-rhel9"
Loading
Loading