diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index be96b21..48f502d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,5 +32,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }} - - name: Bump Chart Version - run: bash ./scripts/bump-app-version.sh publish "${GITHUB_REF##*/}" "${{ secrets.RELEASE_USER_TOKEN }}" \ No newline at end of file + - name: Run chart version bump + uses: mittwald/bump-app-version-action@v1 + with: + mode: 'publish' + chartYaml: './deploy/helm-chart/kubeav/Chart.yaml' + env: + GITHUB_TOKEN: "${{ secrets.RELEASE_USER_TOKEN }}" + HELM_REPO_PASSWORD: "${{ secrets.HELM_REPO_PASSWORD }}" \ No newline at end of file diff --git a/scripts/bump-app-version.sh b/scripts/bump-app-version.sh deleted file mode 100755 index 7845d2a..0000000 --- a/scripts/bump-app-version.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -set -e - -## debug if desired -if [[ -n "${DEBUG}" ]]; then - set -x -fi - -## make this script a bit more re-usable -GIT_REPOSITORY="github.com/mittwald/kube-av.git" -CHART_YAML="./deploy/helm-chart/kubeav/Chart.yaml" - -## avoid noisy shellcheck warnings -MODE="${1}" -TAG="${2:-v0.0.0}" -GITHUB_TOKEN="${3:-dummy}" - -## temp working vars -TIMESTAMP="$(date +%s )" -TMP_DIR="/tmp/${TIMESTAMP}" - -## set up Git-User -git config --global user.name "Mittwald Machine" -git config --global user.email "opensource@mittwald.de" - -## temporary clone git repository -git clone "https://${GIT_REPOSITORY}" "${TMP_DIR}" -cd "${TMP_DIR}" - -## replace appVersion -sed -i "s#appVersion:.*#appVersion: ${TAG}#g" "${CHART_YAML}" - -## replace helm-chart version with current tag without 'v'-prefix -sed -i "s#version:.*#version: ${TAG/v/}#g" "${CHART_YAML}" - -## useful for debugging purposes -git status - -## Add new remote with credentials baked in url -git remote add publisher "https://mittwald-machine:${GITHUB_TOKEN}@${GIT_REPOSITORY}" - -## add and commit changed file -git add -A - -## useful for debugging purposes -git status - -## stage changes -git commit -m "Bump appVersion to '${TAG}' and version to '${TAG/v/}'" - -## rebase -git pull --rebase publisher master - -if [[ "$MODE" == "publish" ]]; then - - ## publish changes - git push publisher master - - ## trigger helm-charts reload - curl -X POST 'https://api.github.com/repos/mittwald/helm-charts/dispatches' -u "mittwald-machine:${GITHUB_TOKEN}" -d '{"event_type": "updateCharts"}' - -fi - -exit 0