Changing helm workflow setting version to chart version as well. #11
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 | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install kustomize | |
uses: imranismail/setup-kustomize@v2 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Process version tag | |
id: version | |
run: |- | |
echo "${{ github.ref_name }}" | sed -r 's/^v//' | | |
xargs printf "version=%s\n" | tee -a "$GITHUB_OUTPUT" | |
if echo "${{ github.ref_name }}" | grep -qE -- '-rc[0-9]+$'; then | |
echo latest=false | tee -a "$GITHUB_OUTPUT" | |
else | |
echo latest=true | tee -a "$GITHUB_OUTPUT" | |
fi | |
- name: Update image tag | |
uses: mikefarah/yq@v4 | |
env: | |
TEMPLATE: |- | |
.images += { | |
"name": "registry.local/backup-operator", | |
"newname": "ghcr.io/${{ github.repository }}", | |
"newTag": "${{ steps.version.outputs.version }}" | |
} | |
with: | |
cmd: yq -i "${TEMPLATE}" src/config/manager/kustomization.yaml | |
- name: Kustomize Build | |
run: kustomize build src/config/default | tee install.yaml | |
- name: CRDs Build | |
run: cat src/config/crd/bases/* | tee crds.yaml | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
make_latest: "${{ steps.version.outputs.latest }}" | |
files: | | |
install.yaml | |
crds.yaml |