Skip to content

Commit 408ced7

Browse files
authored
feat: add project version to repository (#1463)
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent 3b3eb49 commit 408ced7

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

.chainloop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
projectVersion: v0.97.6
2+
13
# Experimental feature used by Chainloop labs shared workflow https://github.com/chainloop-dev/labs
24
# It maps the material names with location in disk so they get automatically attested
35
docs:

.github/workflows/build_and_package.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ jobs:
120120

121121
- name: Bump Chart and Dagger Version
122122
run: .github/workflows/utils/bump-chart-and-dagger-version.sh deployment/chainloop extras/dagger ${{ github.ref_name }}
123+
- name: Bump Project Version
124+
run: .github/workflows/utils/bump-project-version.sh ${{ github.ref_name }}
123125

124126
- name: Create Pull Request
125127
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Bump the Chainloop project version to a specific version number in configFile (defult .chainloop.yml)
4+
5+
set -e
6+
7+
die () {
8+
echo >&2 "$@"
9+
echo "usage: bump-project-version.sh [version] [configFile]"
10+
exit 1
11+
}
12+
13+
## debug if desired
14+
if [[ -n "${DEBUG}" ]]; then
15+
set -x
16+
fi
17+
18+
[ "$#" -ge 1 ] || die "At least 1 arguments required, $# provided"
19+
20+
version="${1}"
21+
# append project path if provided
22+
23+
project_yaml=".chainloop.yml"
24+
# manual override
25+
if [[ -n "${2}" ]]; then
26+
project_yaml="${2}"
27+
fi
28+
29+
## Changes in .chainloop.yml
30+
sed -i "s#^projectVersion:.*#projectVersion: ${version}#g" "${project_yaml}"

0 commit comments

Comments
 (0)