Skip to content

Commit 1351b8b

Browse files
added npm for taggig
1 parent 9889ec9 commit 1351b8b

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

.github/workflows/android-build.yml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,7 @@ jobs:
4040
4141
- name: Set tag name
4242
id: set_tag_name
43-
run: |
44-
# Determine the latest tag and commit messages since that tag
45-
LAST_TAG=$(git describe --tags --abbrev=0)
46-
COMMITS=$(git log --oneline ${LAST_TAG}..HEAD --format="%s")
47-
48-
# Initialize version components
49-
MAJOR=0
50-
MINOR=0
51-
PATCH=0
52-
53-
# Analyze commit messages to determine version bump
54-
while read -r line; do
55-
if [[ "$line" == feat:* ]]; then
56-
# Increment minor version for feature commits
57-
((MINOR++))
58-
elif [[ "$line" == chore:* ]]; then
59-
# Increment major version for chore commits
60-
((MAJOR++))
61-
MINOR=0 # Reset minor version
62-
elif [[ "$line" == fix:* ]]; then
63-
# Increment patch version for fix commits
64-
((PATCH++))
65-
fi
66-
done <<< "$COMMITS"
67-
68-
# Determine the next version based on commit analysis
69-
NEXT_VERSION="${MAJOR}.${MINOR}.${PATCH}"
70-
71-
echo "::set-output name=next_version::$NEXT_VERSION"
43+
uses: martinbeentjes/npm-get-version-action@master
7244

7345
- name: Upload Release APK
7446
uses: actions/upload-artifact@v2
@@ -82,8 +54,8 @@ jobs:
8254
env:
8355
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8456
with:
85-
tag_name: ${{ steps.set_tag_name.outputs.next_version }}
86-
release_name: Release ${{ steps.set_tag_name.outputs.next_version }}
57+
tag_name: ${{ steps.set_tag_name.outputs.current-version }}
58+
release_name: Release ${{ steps.set_tag_name.outputs.current-version }}
8759
draft: false
8860
prerelease: false
8961

0 commit comments

Comments
 (0)