Skip to content

set up helm release

set up helm release #7

Workflow file for this run

name: Release Helm Charts
defaults:
run:
working-directory: deployments/kubernetes/charts/clowder2
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
release:
types:
- 'created'
env:
MAIN_REPO: clowder-framework/clowder2
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get dependencies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
helm dep build
- name: get release info
id: release_info
run: |
version="$(awk '/^version:/ { print $2} ' Chart.yaml)"
changelog="$(sed -e "1,/^### ${version}/d" -e "/^###/,\$d" -e '/^$/d' README.md)"
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "$version=${$version}" >> $GITHUB_ENV
echo "$changelog=${$changelog}" >> $GITHUB_ENV
- name: Print Github Info
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.repository: ${{ github.repository }}"
echo "github.ref: ${{ github.ref }}"
- name: run helm template
run: helm template .
- name: Publish to NCSA OpenSource
if: |
github.event_name != 'pull_request'
&& github.repository == env.MAIN_REPO
&& startsWith(github.ref, 'refs/tags/')
&& contains(github.ref, 'v2.0.0')
uses: bsord/[email protected]
with:
username: ${{ secrets.HELM_USERNAME }}
password: ${{ secrets.HELM_PASSWORD }}
registry-url: "https://opensource.ncsa.illinois.edu/charts"
chart-folder: "."
force: true
- name: create release
if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: Release ${{ env.version }}
body: ${{ env.changelog }}
- name: Upload Release Asset
if: github.event_name != 'pull_request' && github.repository == env.MAIN_REPO
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./incore-${{ env.version }}.tgz
asset_name: incore-${{ env.version }}.tgz
asset_content_type: application/zip