Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
maphel authored Sep 4, 2023
1 parent e3f9b25 commit bf5bbe9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Release

on:
push:
Expand Down Expand Up @@ -48,10 +48,15 @@ jobs:
with:
ref: main

- name: Extract version from latest Git tag
- name: Extract version from latest Git tag or use default
run: |
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
VERSION=${TAG_NAME#*v}
TAG_NAME=$(git tag | tail -n 1) # Fetch the latest tag
if [ -z "$TAG_NAME" ]; then # Check if TAG_NAME is empty
echo "No tags found. Using default version 1.0.0."
VERSION="1.0.0"
else
VERSION=${TAG_NAME#*v}
fi
npm version $VERSION --no-git-tag-version
- name: Commit and push updated package.json on main
Expand Down

0 comments on commit bf5bbe9

Please sign in to comment.