Skip to content

Commit 28452ee

Browse files
committed
add a manual action to publish the chart
1 parent 8e34403 commit 28452ee

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Manual Publish Helm Chart
2+
3+
defaults:
4+
run:
5+
working-directory: deployments/kubernetes/charts/clowder2
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
force:
11+
description: "Force push the chart even if it already exists (true/false)"
12+
type: boolean
13+
default: true
14+
15+
env:
16+
MAIN_REPO: clowder-framework/clowder2
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Helm Repositories
29+
run: |
30+
helm repo add bitnami-legacy https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
31+
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
32+
helm repo update
33+
helm dep update
34+
35+
- name: Determine Chart Version & Changelog
36+
id: release_info
37+
run: |
38+
version="$(awk '/^version:/ { print $2 }' Chart.yaml)"
39+
changelog="$(sed -e "1,/^### ${version}/d" -e "/^###/,\$d" -e '/^$/d' README.md)"
40+
changelog="${changelog//'%'/'%25'}"
41+
changelog="${changelog//$'\n'/'%0A'}"
42+
changelog="${changelog//$'\r'/'%0D'}"
43+
echo "version=${version}" >> $GITHUB_ENV
44+
echo "changelog=${changelog}" >> $GITHUB_ENV
45+
echo "version: ${version}"
46+
echo "changelog: ${changelog}"
47+
48+
- name: Debug GitHub Metadata
49+
run: |
50+
echo "Manual dispatch workflow triggered"
51+
echo "github.repository: ${{ github.repository }}"
52+
echo "chart version: ${{ env.version }}"
53+
54+
- name: Validate Helm Template
55+
run: helm template .
56+
57+
- name: Publish Helm Chart to NCSA OpenSource
58+
if: github.repository == env.MAIN_REPO
59+
uses: bsord/[email protected]
60+
with:
61+
username: ${{ secrets.HELM_USERNAME }}
62+
password: ${{ secrets.HELM_PASSWORD }}
63+
registry-url: "https://opensource.ncsa.illinois.edu/charts"
64+
chart-folder: "deployments/kubernetes/charts/clowder2"
65+
force: ${{ github.event.inputs.force }}

.github/workflows/helm-release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222

2323
- name: Get dependencies
2424
run: |
2525
helm repo add bitnami-legacy https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
2626
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
27+
helm repo update
2728
helm dep update
2829
2930
- name: Get release info

0 commit comments

Comments
 (0)