Skip to content

Commit

Permalink
feat: bump next version (chainloop-dev#1471)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Martinez <[email protected]>
  • Loading branch information
migmartri authored Nov 4, 2024
1 parent 243c72d commit 16a498a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .chainloop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
projectVersion: v0.97.7
# This can indicate the next version and by default it will be marked as pre-release
projectVersion: v0.98.0

# Experimental feature used by Chainloop labs shared workflow https://github.com/chainloop-dev/labs
# It maps the material names with location in disk so they get automatically attested
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- name: Bump Chart and Dagger Version
run: .github/workflows/utils/bump-chart-and-dagger-version.sh deployment/chainloop extras/dagger ${{ github.ref_name }}
- name: Bump Project Version
run: .github/workflows/utils/bump-project-version.sh ${{ github.ref_name }}
run: .github/workflows/utils/bump-project-version.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/utils/bump-project-version.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
#!/usr/bin/env bash

# Bump the Chainloop project version to a specific version number in configFile (defult .chainloop.yml)
# Bump the Chainloop project version to the next minor version to the version defined .chainloop.yml

set -e

die () {
echo >&2 "$@"
echo "usage: bump-project-version.sh [version] [configFile]"
exit 1
echo >&2 "$@"
echo "usage: bump-project-version.sh [configFile]"
exit 1
}

## debug if desired
if [[ -n "${DEBUG}" ]]; then
set -x
set -x
fi

[ "$#" -ge 1 ] || die "At least 1 arguments required, $# provided"

version="${1}"
# append project path if provided

project_yaml=".chainloop.yml"
# manual override
if [[ -n "${2}" ]]; then
project_yaml="${2}"
if [[ -n "${1}" ]]; then
project_yaml="${1}"
fi

# load the previous version and BUMP THE MINOR
version=$(cat ${project_yaml} | awk -F'[ .]' '/^projectVersion:/ {print $2"."$3+1"."0}')

## Changes in .chainloop.yml
sed -i "s#^projectVersion:.*#projectVersion: ${version}#g" "${project_yaml}"
sed -i "s#^projectVersion:.*#projectVersion: ${version}#g" "${project_yaml}"

0 comments on commit 16a498a

Please sign in to comment.