Skip to content

Commit c2eba8b

Browse files
committed
fix: enhance release task to validate version format and improve tagging process
1 parent 4a11988 commit c2eba8b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Taskfile.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,20 @@ tasks:
6565
release:
6666
desc: Create a tag on the current commit and push it to the remote to create the release
6767
cmds:
68-
- |
69-
if [ -z "{{.CLI_ARGS}}" ]; then
70-
echo "Error: Version argument is required. Usage: task release -- <version>"
68+
- echo "Create tag version {{ .TAG }}"
69+
- git tag "{{ .TAG }}"
70+
- git push origin "{{ .TAG }}"
71+
vars:
72+
TAG:
73+
sh: |
74+
TAGARG="{{.CLI_ARGS}}"
75+
if ! echo "$TAGARG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+.*$'; then
76+
echo "Error: Version must match pattern 'v[0-9]+.[0-9]+.[0-9]+*'"
77+
echo " Invalid version: $TAGARG"
78+
echo " Valid examples: v1.0.0, v2.1.3, v1.0.0-beta, v3.2.1-rc.1"
7179
exit 1
7280
fi
73-
- git tag -a "{{.CLI_ARGS}}" -m "Release {{.CLI_ARGS}}"
74-
- git push origin "{{.CLI_ARGS}}"
75-
81+
echo $TAGARG
7682
board:install:
7783
desc: Install arduino-router on the board
7884
interactive: true

0 commit comments

Comments
 (0)