@@ -3,9 +3,18 @@ name: Bump Digma Jaeger UI version and push git tag
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
- version :
7
- description : ' Version to set (e.g., 1.2.3) '
6
+ version_type :
7
+ description : ' Type of version bump '
8
8
required : true
9
+ type : choice
10
+ options :
11
+ - major
12
+ - minor
13
+ - patch
14
+ - premajor
15
+ - preminor
16
+ - prepatch
17
+ - prerelease
9
18
10
19
jobs :
11
20
bump :
@@ -24,14 +33,29 @@ jobs:
24
33
VERSION=$(jq -r '.version' ./packages/jaeger-ui/package.json)
25
34
echo "VERSION=$VERSION" >> $GITHUB_ENV
26
35
36
+ - name : Get current digma-jaeger-ui version
37
+ id : get-version
38
+ run : |
39
+ CURRENT_DIGMA_JAEGER_UI_VERSION=$(jq -r '.["digma-jaeger-ui-version"]' ./packages/jaeger-ui/package.json)
40
+ echo "CURRENT_DIGMA_JAEGER_UI_VERSION=$CURRENT_DIGMA_JAEGER_UI_VERSION" >> $GITHUB_ENV
41
+
42
+ - name : Calculate next digma-jaeger-ui version
43
+ run : |
44
+ if [[ "${{ inputs.version_type }}" == "prerelease" || "${{ inputs.version_type }}" == "premajor" || "${{ inputs.version_type }}" == "preminor" || "${{ inputs.version_type }}" == "prepatch" ]]; then
45
+ NEXT_DIGMA_JAEGER_UI_VERSION=$(npx semver $CURRENT_DIGMA_JAEGER_UI_VERSION -i ${{ inputs.version_type }} --preid alpha)
46
+ else
47
+ NEXT_DIGMA_JAEGER_UI_VERSION=$(npx semver $CURRENT_DIGMA_JAEGER_UI_VERSION -i ${{ inputs.version_type }})
48
+ fi
49
+ echo "NEXT_DIGMA_JAEGER_UI_VERSION=$NEXT_DIGMA_JAEGER_UI_VERSION" >> $GITHUB_ENV
50
+
27
51
- name : Update digma-jaeger-ui version
28
52
run : |
29
- jq '.["digma-jaeger-ui-version"] = "${{ inputs.version }}"' ./packages/jaeger-ui/package.json > tmp.$$.json && mv tmp.$$.json ./packages/jaeger-ui/package.json
53
+ jq '.["digma-jaeger-ui-version"] = "${{ env.NEXT_DIGMA_JAEGER_UI_VERSION }}"' ./packages/jaeger-ui/package.json > tmp.$$.json && mv tmp.$$.json ./packages/jaeger-ui/package.json
30
54
31
55
- run : |
32
- TAG="v${{ env.VERSION }}-digma.${{ inputs.version }}"
56
+ TAG="v${{ env.VERSION }}-digma.${{ env.NEXT_DIGMA_JAEGER_UI_VERSION }}"
33
57
git add packages/jaeger-ui/package.json
34
- git commit -m "Bump Digma Jaeger UI version to ${{ inputs.version }} [skip ci]"
58
+ git commit -m "Bump Digma Jaeger UI version to ${{ env.NEXT_DIGMA_JAEGER_UI_VERSION }} [skip ci]"
35
59
git tag $TAG
36
60
git push
37
61
git push origin $TAG
0 commit comments