diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1b40415..fa1aa7f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,3 +26,18 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }} + + bump-version: + name: Bump app version in Helm chart + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Bump chart version + uses: mittwald/bump-app-version-action@v1 + with: + mode: 'publish' + chartYaml: './deploy/helm-chart/servicegateway/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 a72a460..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/servicegateway.git" -CHART_YAML="./deploy/helm-chart/servicegateway/Chart.yaml" - -## avoid noisy shellcheck warnings -TRAVIS_TAG="${TRAVIS_TAG:-v0.0.0}" -GITHUB_TOKEN="${GITHUB_TOKEN:-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: ${TRAVIS_TAG}#g" "${CHART_YAML}" - -## replace chart version with current tag without 'v'-prefix -sed -i "s#version:.*#version: ${TRAVIS_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 '${TRAVIS_TAG}'" - -## rebase -git pull --rebase publisher master - -if [[ "${1}" == "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 \ No newline at end of file