|
| 1 | +name: Release Helm Charts |
| 2 | + |
| 3 | +defaults: |
| 4 | + run: |
| 5 | + working-directory: deployments/kubernetes/charts/clowder2 |
| 6 | + |
| 7 | +on: |
| 8 | + release: |
| 9 | + types: [published] |
| 10 | + |
| 11 | +env: |
| 12 | + MAIN_REPO: clowder-framework/clowder2 |
| 13 | + |
| 14 | +jobs: |
| 15 | + release: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Get dependencies |
| 24 | + run: | |
| 25 | + helm repo add bitnami https://charts.bitnami.com/bitnami |
| 26 | + helm repo add ncsa https://opensource.ncsa.illinois.edu/charts |
| 27 | + helm dep build |
| 28 | +
|
| 29 | + - name: Get release info |
| 30 | + id: release_info |
| 31 | + run: | |
| 32 | + version="$(awk '/^version:/ { print $2} ' Chart.yaml)" |
| 33 | + changelog="$(sed -e "1,/^### ${version}/d" -e "/^###/,\$d" -e '/^$/d' README.md)" |
| 34 | + changelog="${changelog//'%'/'%25'}" |
| 35 | + changelog="${changelog//$'\n'/'%0A'}" |
| 36 | + changelog="${changelog//$'\r'/'%0D'}" |
| 37 | + echo "version=${version}" >> $GITHUB_ENV |
| 38 | + echo "changelog=${changelog}" >> $GITHUB_ENV |
| 39 | + echo "version: ${version}" |
| 40 | + echo "changelog: ${changelog}" |
| 41 | +
|
| 42 | + - name: Print Github Info |
| 43 | + run: | |
| 44 | + echo "github.event_name: ${{ github.event_name }}" |
| 45 | + echo "github.repository: ${{ github.repository }}" |
| 46 | + echo "github.ref: ${{ github.ref }}" |
| 47 | +
|
| 48 | + - name: run helm template |
| 49 | + run: helm template . |
| 50 | + |
| 51 | + - name: Publish to NCSA OpenSource |
| 52 | + if: | |
| 53 | + github.event_name != 'pull_request' |
| 54 | + && github.repository == env.MAIN_REPO |
| 55 | + |
| 56 | + with: |
| 57 | + username: ${{ secrets.HELM_USERNAME }} |
| 58 | + password: ${{ secrets.HELM_PASSWORD }} |
| 59 | + registry-url: "https://opensource.ncsa.illinois.edu/charts" |
| 60 | + chart-folder: "deployments/kubernetes/charts/clowder2" |
| 61 | + force: true |
0 commit comments