File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Finmars CI/CD
2+
3+ on :
4+ push :
5+ branches :
6+ - ' *'
7+ tags :
8+ - ' *'
9+ pull_request :
10+
11+
12+ jobs :
13+ versioning :
14+ name : Generate Docker Version
15+ runs-on : ubuntu-latest
16+ outputs :
17+ version : ${{ steps.version.outputs.version }}
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v3
21+
22+ - name : Determine new version
23+ id : version
24+ run : |
25+ BASE_VERSION="${BASE_VERSION:-1.17.0}"
26+ echo "Base version: $BASE_VERSION"
27+
28+ IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE_VERSION"
29+
30+ if [[ "${GITHUB_REF##*/}" == "stable" ]]; then
31+ ((MINOR++))
32+ PATCH=0
33+ VERSION="$MAJOR.$MINOR.$PATCH"
34+ else
35+ ((PATCH++))
36+ VERSION="$MAJOR.$MINOR.$PATCH"
37+ fi
38+
39+ echo "New version: $VERSION"
40+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
41+
42+ - name : Output new version
43+ run : echo "Version is ${{ steps.version.outputs.version }}"
You can’t perform that action at this time.
0 commit comments