Skip to content

[BE][FE][RELEASE][HELM] Release Helm Charts #60

[BE][FE][RELEASE][HELM] Release Helm Charts

[BE][FE][RELEASE][HELM] Release Helm Charts #60

# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: "[BE][FE][RELEASE][HELM] Release Helm Charts"
on:
workflow_dispatch: # Trigger manually
jobs:
Get-helm-charts-versions:
outputs:
latest_version: ${{ steps.step1.outputs.latest_version }}
current_version: ${{ steps.step2.outputs.current_version }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get backend helm charts latest tag version
id: step1
run: |
latestVersion=$(git tag | grep -e "^helm-charts-" | tail -1)
echo "latest_version=$latestVersion" >> $GITHUB_OUTPUT
echo "Exported $latestVersion latest backend helm charts version"
- name: Get backend helm charts current version
id: step2
run: |
chartVersion=helm-charts-$(cat ./charts/traceability-foss/Chart.yaml | grep "version:" | head -1 | cut -d ":" -d " " -f2)
echo "current_version=$chartVersion" >> $GITHUB_OUTPUT
echo "Exported $chartVersion backend helm charts version"
Release-helm-charts:
needs: "Get-helm-charts-versions"
if: needs.Get-helm-charts-versions.outputs.latest_version != needs.Get-helm-charts-versions.outputs.current_version
permissions:
contents: write
runs-on: ubuntu-latest
env:
RELEASE_VERSION: "${{needs.Get-helm-charts-versions.outputs.current_version}}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.10.0
- name: Add Helm repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add runix https://helm.runix.net
helm repo add item-relationship-service https://eclipse-tractusx.github.io/item-relationship-service
helm repo add tx-item-relationship-service https://catenax-ng.github.io/tx-item-relationship-service
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
mark_as_latest: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "${{ env.RELEASE_VERSION }}"