build(release): improve version scheme

Amolith created

Change summary

Taskfile.yaml | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

Detailed changes

Taskfile.yaml 🔗

@@ -121,17 +121,11 @@ tasks:
     vars:
       UPSTREAM_VERSION:
         sh: git describe --tags --abbrev=0 upstream/main 2>/dev/null || echo "v0.0.0"
-      FORK_VERSION:
-        sh: |
-          UP=$(git describe --tags --abbrev=0 upstream/main 2>/dev/null | sed 's/^v//' || echo "0.0.0")
-          MAJOR=$(echo $UP | cut -d. -f1)
-          MINOR=$(echo $UP | cut -d. -f2)
-          PATCH=$(echo $UP | cut -d. -f3)
-          NEXT_PATCH=$((PATCH + 1))
-          # Count existing fork tags for this base version
-          EXISTING=$(git tag -l "v$MAJOR.$MINOR.$NEXT_PATCH" "v$MAJOR.$MINOR.$((NEXT_PATCH+1))" "v$MAJOR.$MINOR.$((NEXT_PATCH+2))" | wc -l)
-          echo "v$MAJOR.$MINOR.$((NEXT_PATCH + EXISTING))"
-      TAG: "{{.FORK_VERSION}}"
+      EXISTING_FORK_TAGS:
+        sh: git tag -l "{{.UPSTREAM_VERSION}}-fork.*" | wc -l
+      NEXT_NUM:
+        sh: echo $(({{.EXISTING_FORK_TAGS}} + 1))
+      TAG: "{{.UPSTREAM_VERSION}}-fork.{{.NEXT_NUM}}"
     prompt: "Create fork release {{.TAG}}?"
     preconditions:
       - sh: '[ $(git symbolic-ref --short HEAD) = "dev" ]'
@@ -144,3 +138,5 @@ tasks:
       - git tag -a {{.TAG}}
       - git push soft {{.TAG}}
       - echo "Released {{.TAG}}"
+      - go list -m git.secluded.site/crush@{{.TAG}} > /dev/null
+      - echo "Module proxy notified"