1+ ---
2+ name : Release Helm charts
3+ on :
4+ push :
5+ workflow_dispatch :
6+ inputs :
7+ tag :
8+ description : ' Tag in semver format'
9+ required : true
10+
11+ jobs :
12+ container_prod_all_providers :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+ with :
17+ fetch-depth : 0 # ct list-changed below needs this
18+ - uses : azure/setup-helm@v1
19+ - uses : actions/setup-python@v2
20+ with :
21+ python-version : 3.7
22+ - name : Set up chart-testing
23+ 24+ - name : Run chart-testing (list-changed)
25+ id : list-changed
26+ run : |
27+ changed=$(ct list-changed --chart-dirs helm-charts --target-branch main)
28+ if [[ -n "$changed" ]]; then
29+ echo "::set-output name=changed::true"
30+ fi
31+ - name : Run chart-testing (lint)
32+ run : ct lint --chart-dirs helm-charts --all --validate-maintainers=false --chart-repos bitnami=https://charts.bitnami.com/bitnami
33+ - name : Package charts
34+ run : |
35+ set -e
36+ cd docs/
37+ helm package ../helm-charts/*
38+ helm repo index --url https://puppetlabs.github.io/vmpooler-deployment/ .
39+ - uses : EndBug/add-and-commit@v9 # You can change this to use a specific version.
40+ with :
41+ add : docs
42+ message : release helm-chart version ${{ github.event.inputs.tag }}
43+ - name : Generate Release Body
44+ env :
45+ RELEASE_BODY_FILE : " ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md"
46+ run : |
47+ echo "#Components" > ${RELEASE_BODY_FILE}
48+ echo "" >> ${RELEASE_BODY_FILE}
49+ echo "This release includes the following:" >> ${RELEASE_BODY_FILE}
50+ echo "" >> ${RELEASE_BODY_FILE}
51+ echo "##Source image" >> ${RELEASE_BODY_FILE}
52+ echo "" >> ${RELEASE_BODY_FILE}
53+ echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE}
54+ echo "" >> ${RELEASE_BODY_FILE}
55+ echo "##Gems" >> ${RELEASE_BODY_FILE}
56+ echo "" >> ${RELEASE_BODY_FILE}
57+ echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
58+ echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
59+ echo "${RELEASE_BODY_FILE}"
60+ - name : Tag Release
61+ uses : ncipollo/release-action@v1
62+ with :
63+ tag : ${{ github.event.inputs.tag }}-prod-all-providers
64+ token : ${{ secrets.GITHUB_TOKEN }}
65+ draft : false
66+ prerelease : false
67+ bodyFile : ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md
68+ generateReleaseNotes : true
0 commit comments