Skip to content

Commit

Permalink
feat: add helm packaging and publish
Browse files Browse the repository at this point in the history
Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed Apr 5, 2024
1 parent 438a675 commit baab2ec
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
branches:
- main
paths:
- 'charts/**'
- "charts/**"
tags:
- 'chart-*'
- "chart-*"

jobs:
release-chart:
Expand All @@ -16,8 +16,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Configure Helm
run: helm version
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Package Helm chart
run: |
Expand All @@ -26,16 +29,18 @@ jobs:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(cat charts/my-chart/Chart.yaml | grep version: | cut -d ' ' -f 2)
run: |
VERSION=$(cat charts/my-chart/Chart.yaml | grep version: | cut -d ' ' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: chart-${{ steps.get_version.outputs.VERSION }}
release_name: Chart Release ${{ steps.get_version.outputs.VERSION }}
tag_name: chart-${{ env.VERSION }}
release_name: Chart Release ${{ env.VERSION }}
draft: false
prerelease: false

Expand All @@ -45,7 +50,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/my-chart-${{ steps.get_version.outputs.VERSION }}.tgz
asset_name: my-chart-${{ steps.get_version.outputs.VERSION }}.tgz
asset_path: ./release/my-chart-${{ env.VERSION }}.tgz
asset_name: my-chart-${{ env.VERSION }}.tgz
asset_content_type: application/octet-stream

0 comments on commit baab2ec

Please sign in to comment.