push changes #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Helm | |
on: | |
push: | |
branches: | |
- 'releases/*/v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.10.0 | |
- name: Install yq | |
uses: mikefarah/[email protected] | |
- name: Login to mrmhub | |
run: | | |
echo '${{ secrets.MRMHUB_PASSWORD }}' | helm registry login mrmhub.io --username '${{ secrets.MRMHUB_USERNAME }}' --password-stdin | |
- name: Configure chart version | |
id: chart_meta | |
run: | | |
cat >> "$GITHUB_OUTPUT" <<EOF | |
chart_name=$(cut -d / -f 4 <<<"${{ github.ref }}") | |
chart_version=$(cut -d / -f 5- <<<"${{ github.ref }}") | |
EOF | |
- name: Update chart version | |
run: | | |
chart_file="${{ steps.chart_meta.outputs.chart_name }}/Chart.yaml" | |
yq '.version = "${{ steps.chart_meta.outputs.chart_version }}"' \ | |
"${chart_file}" > "${chart_file}.updated" | |
if ! diff -q "${chart_file}" "${chart_file}.updated"; then | |
mv -f "${chart_file}.updated" "${chart_file}" | |
fi | |
if ! git --no-pager diff --exit-code; then | |
git commit -a -m 'chart version updated' | |
fi | |
make helm-docs | |
if ! git --no-pager diff --exit-code; then | |
git commit -a -m 'chart docs updated' | |
fi | |
if ! git --no-pager diff --exit-code "origin/${{ github.ref_name }}"..HEAD; then | |
git push origin "${{ github.ref_name }}" | |
exit 1 | |
fi | |
# - name: Package chart | |
# run: | | |
# helm package "${{ steps.chart_meta.outputs.chart_name }}" --version "${{ steps.chart_meta.outputs.chart_version }}" | |
# - name: Upload chart | |
# run: | | |
# helm push "${{ steps.chart_meta.outputs.chart_name }}-${{ steps.chart_meta.outputs.chart_version }}.tgz" oci://mrmhub.io/mikemrm |