File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,8 +4,14 @@ updates:
44 directory : " /"
55 schedule :
66 interval : " weekly"
7+ day : " tuesday"
8+ open-pull-requests-limit : 5
9+ allow :
10+ - dependency-type : " direct"
711
812 - package-ecosystem : " github-actions"
913 directory : " /"
1014 schedule :
1115 interval : " weekly"
16+ day : " tuesday"
17+ open-pull-requests-limit : 5
Original file line number Diff line number Diff line change 3737 - name : Build
3838 run : dotnet build MdTerm.csproj -c Release -r ${{ matrix.runtime }}
3939
40+ - name : Test
41+ run : dotnet test -c Release --no-build
42+
4043 tag :
4144 needs : build
4245 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -56,15 +59,31 @@ jobs:
5659 if [ -z "$LATEST_TAG" ]; then
5760 NEXT="v0.1.0"
5861 else
62+ COMMITS=$(git log "${LATEST_TAG}..HEAD" --pretty=format:"%s%n%b")
63+
64+ BUMP="patch"
65+ if echo "$COMMITS" | grep -qiE 'BREAKING CHANGE:|^[a-z]+(\(.+\))?!:'; then
66+ BUMP="major"
67+ elif echo "$COMMITS" | grep -qE '^feat(\(.+\))?:'; then
68+ BUMP="minor"
69+ fi
70+
5971 VERSION=${LATEST_TAG#v}
6072 MAJOR=$(echo "$VERSION" | cut -d. -f1)
6173 MINOR=$(echo "$VERSION" | cut -d. -f2)
6274 PATCH=$(echo "$VERSION" | cut -d. -f3)
63- NEXT="v${MAJOR}.${MINOR}.$((PATCH + 1))"
75+
76+ case "$BUMP" in
77+ major) NEXT="v$((MAJOR + 1)).0.0" ;;
78+ minor) NEXT="v${MAJOR}.$((MINOR + 1)).0" ;;
79+ patch) NEXT="v${MAJOR}.${MINOR}.$((PATCH + 1))" ;;
80+ esac
6481 fi
6582 echo "next=$NEXT" >> "$GITHUB_OUTPUT"
83+ echo "bump=$BUMP" >> "$GITHUB_OUTPUT"
6684
6785 - name : Create and push tag
6886 run : |
87+ echo "Creating ${{ steps.version.outputs.next }} (${{ steps.version.outputs.bump }} bump)"
6988 git tag "${{ steps.version.outputs.next }}"
7089 git push origin "${{ steps.version.outputs.next }}"
You can’t perform that action at this time.
0 commit comments