|
| 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 | + |
| 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 }} |
0 commit comments