forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathrelease-process-fbc-fragment.yaml
More file actions
68 lines (62 loc) · 2.66 KB
/
release-process-fbc-fragment.yaml
File metadata and controls
68 lines (62 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: FBC Processor
run-name: FBC Processor
on:
workflow_dispatch:
inputs:
previous-version:
type: string
description: |
(Optional) Manual override for the previous version to replace.
If not provided, will auto-calculate based on branch version.
Use this for custom upgrade paths or when auto-detection fails.
required: false
permissions:
contents: write
jobs:
process-fbc:
if: ${{ github.ref_name != 'main' && startsWith(github.ref_name, 'odh-3.') }}
runs-on: ubuntu-latest
steps:
- name: Get Current branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: get_branch
- name: Git checkout current branch
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
ref: ${{ steps.get_branch.outputs.branch }}
path: ${{ steps.get_branch.outputs.branch }}
fetch-depth: 0
- name: Generate FBC Fragment
id: generate-fbc-fragment
env:
PREV_VERSION_INPUT: ${{ github.event.inputs.previous-version }}
run: |
BRANCH_NAME=${{ steps.get_branch.outputs.branch }}
QUAY_IMG=quay.io/opendatahub/opendatahub-operator-bundle
cd $BRANCH_NAME
sed -i '/# Ignore catalog related files/d' .gitignore
sed -i '/catalog\//d' .gitignore
# Extract version from branch name (strip 'odh-' prefix)
CURRENT_VERSION=${BRANCH_NAME#odh-}
# Use environment variable to prevent command injection
MANUAL_PREV="$PREV_VERSION_INPUT"
if [[ -n "$MANUAL_PREV" ]]; then
PREV_VERSION=$(.github/scripts/calculate-previous-version.sh "$CURRENT_VERSION" "$MANUAL_PREV")
echo "Using manual override for previous version"
else
PREV_VERSION=$(.github/scripts/calculate-previous-version.sh "$CURRENT_VERSION")
echo "Auto-calculated previous version"
fi
echo "Current version: $CURRENT_VERSION"
echo "Previous version: $PREV_VERSION"
make catalog-prepare -e BUNDLE_IMGS=${QUAY_IMG}:v${PREV_VERSION},${QUAY_IMG}:v${CURRENT_VERSION}
- name: Push latest FBC artifacts
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
with:
branch: ${{ steps.get_branch.outputs.branch }}
github_token: ${{ secrets.GITHUB_TOKEN }}
message: "Regenerated the catalog.yaml"
directory: ${{ steps.get_branch.outputs.branch }}
author_name: OpenShift AI Core Platform Team
author_email: openshift-ai-platform@redhat.com