Skip to content

Merge pull request #230 from catenax-ng/main #25

Merge pull request #230 from catenax-ng/main

Merge pull request #230 from catenax-ng/main #25

name: Release Helm Charts
on:
workflow_dispatch: # Trigger manually
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
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@v3
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@v3
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@v3
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.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "${{ env.RELEASE_VERSION }}"