build(release): add fork command

Amolith created

Change summary

Taskfile.yaml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Detailed changes

Taskfile.yaml 🔗

@@ -123,3 +123,28 @@ tasks:
     cmds:
       - git tag -d nightly || true
       - git fetch --tags
+
+  release:fork:
+    desc: Create and push a fork release tag
+    vars:
+      UPSTREAM_VERSION:
+        sh: git describe --tags --abbrev=0 upstream/main 2>/dev/null || echo "v0.0.0"
+      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" ]'
+        msg: Not on dev branch
+      - sh: "[ $(git status --porcelain=2 | wc -l) = 0 ]"
+        msg: "Git is dirty"
+    cmds:
+      - git tag -d nightly || true
+      - git fetch upstream --tags
+      - 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"