-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script to increment helm charts version (#400)
- Loading branch information
1 parent
59baaa2
commit f83450d
Showing
8 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Release Helm Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions | ||
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.8.2 | ||
|
||
- name: Add Helm repos | ||
run: | | ||
helm repo add crate-operator https://crate.github.io/crate-operator | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: deploy/charts | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_GIT_REPO: crate-operator |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Script to increment Helm chart version | ||
# | ||
# Usage: | ||
# $ bumpversion.sh VERSION | ||
# | ||
# Example: | ||
# $ bumpversion.sh 2.14.0 | ||
|
||
function print_error() { | ||
echo -e "\033[31mERROR:\033[0m $1" | ||
} | ||
|
||
function print_info() { | ||
echo -e "\033[32mINFO:\033[0m $1" | ||
} | ||
|
||
VERSION="$1" | ||
|
||
git fetch origin > /dev/null | ||
# get current branch | ||
BRANCH=$(git branch | grep "^\*" | cut -d " " -f 2) | ||
print_info "Current branch is '$BRANCH'." | ||
|
||
if [ "$BRANCH" != "release/$VERSION" ]; then | ||
print_error "You should be on a release branch." | ||
print_error "Please start a new branch ``release/$VERSION``." | ||
exit 1 | ||
fi | ||
|
||
print_info "Incrementing crate-operator Helm Chart to version '$VERSION'" | ||
# Chart version | ||
sed -i "s/^version:.*$/version: $VERSION/" deploy/charts/crate-operator/Chart.yaml | ||
# App version | ||
sed -i "s/^appVersion:.*$/appVersion: \"$VERSION\"/" deploy/charts/crate-operator/Chart.yaml | ||
# Dependency version | ||
sed -i "s/^ version:.*$/ version: $VERSION/" deploy/charts/crate-operator/Chart.yaml | ||
|
||
|
||
print_info "Incrementing crate-operator-crds Helm Chart to version '$VERSION'" | ||
# Chart version | ||
sed -i "s/^version:.*$/version: $VERSION/" deploy/charts/crate-operator-crds/Chart.yaml | ||
# App version | ||
sed -i "s/^appVersion:.*$/appVersion: \"$VERSION\"/" deploy/charts/crate-operator-crds/Chart.yaml | ||
|
||
|
||
print_info "Done. ✨" |
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