Skip to content

Commit 5bbf457

Browse files
chore: tighten up security with dependabot updates. Better handling of versioning.
1 parent 94eb354 commit 5bbf457

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/build.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
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 }}"

0 commit comments

Comments
 (0)