Freeze helm release tag in helm charts on manual event #1
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
# Copyright (C) 2024 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Freeze helm release tag in helm charts on manual event | |
on: | |
workflow_dispatch: | |
inputs: | |
oldappversion: | |
default: "v0.8" | |
description: "Old appVersion to be replaced" | |
required: true | |
type: string | |
newappversion: | |
default: "v0.9" | |
description: "New appVersion to replace" | |
required: true | |
type: string | |
oldversion: | |
default: "0.8.0" | |
description: "Old version to be replaced" | |
required: true | |
type: string | |
newversion: | |
default: "0.9.0" | |
description: "New version to replace" | |
required: true | |
type: string | |
jobs: | |
freeze-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Set up Git | |
run: | | |
git config --global user.name "NeuralChatBot" | |
git config --global user.email "[email protected]" | |
git remote set-url origin https://NeuralChatBot:"${{ secrets.ACTION_TOKEN }}"@github.com/opea-project/GenAIInfra.git | |
- name: Run script | |
env: | |
NEWTAG: ${{ inputs.newappversion }} | |
run: | | |
find helm-charts/ -name 'Chart.yaml' -type f -exec sed -i "s#appVersion: \"${{ inputs.oldappversion }}\"#appVersion: \"${{ inputs.newappversion }}\"#g" {} \; | |
find helm-charts/ -name 'Chart.yaml' -type f -exec sed -i "s#version: ${{ inputs.oldversion }}#version: ${{ inputs.newversion }}#g" {} \; | |
./helm-charts/update_manifests.sh | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -s -m "Freeze Helm charts versions" | |
git push |