File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-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="${{ env.BASE_VERSION }}"
26+ BASE_VERSION="${BASE_VERSION:-1.17.0}"
27+ echo "Base version: $BASE_VERSION"
28+
29+ IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE_VERSION"
30+
31+ if [[ "${GITHUB_REF##*/}" == "stable" ]]; then
32+ ((MINOR++))
33+ PATCH=0
34+ VERSION="$MAJOR.$MINOR.$PATCH"
35+ else
36+ ((PATCH++))
37+ VERSION="$MAJOR.$MINOR.$PATCH"
38+ fi
39+
40+ echo "New version: $VERSION"
41+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
42+
43+ - name : Output new version
44+ run : echo "Version is ${{ steps.version.outputs.version }}"
You can’t perform that action at this time.
0 commit comments