-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #960 from eclipse-tractusx/cicd/release-charts
cicd: only release chart if it is a release version
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,12 @@ name: Release Charts | |
on: | ||
workflow_dispatch: | ||
push: | ||
# prevent unnecessary GH action runs for files outside of charts folder | ||
paths: | ||
- 'charts/**' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions | ||
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
|
@@ -41,17 +37,28 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for Release Version | ||
id: checkRelease | ||
run: | | ||
CHART_VERSION=$(grep 'version:' ./charts/bpdm/Chart.yaml | head -n1 | awk '{ print $2}') | ||
SNAPSHOT=$(echo $CHART_VERSION | grep 'SNAPSHOT') | ||
if test -z $SNAPSHOT; then IS_RELEASE=true; else IS_RELEASE=false fi | ||
echo "isRelease=$IS_RELEASE" >> GITHUB_OUTPUT | ||
- name: Configure Git | ||
if: steps.checkRelease.outputs.isRelease == 'true' | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
if: steps.checkRelease.outputs.isRelease == 'true' | ||
uses: azure/setup-helm@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run chart-releaser | ||
if: steps.checkRelease.outputs.isRelease == 'true' | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |