Skip to content

Commit 6556d27

Browse files
committed
Auto-increment prerelease tags from v0.1.x
1 parent 889958b commit 6556d27

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ jobs:
7575
tag_name="${GITHUB_REF_NAME}"
7676
prerelease="false"
7777
else
78-
tag_name="v0.0.${GITHUB_RUN_NUMBER}"
78+
git fetch --tags --force
79+
latest_patch="$(git tag -l 'v0.1.*' | sed -E 's/^v0\\.1\\.([0-9]+)$/\\1/' | sort -n | tail -n1)"
80+
if [[ -z "${latest_patch}" ]]; then
81+
next_patch="1"
82+
else
83+
next_patch="$((latest_patch + 1))"
84+
fi
85+
tag_name="v0.1.${next_patch}"
7986
prerelease="true"
8087
fi
8188
echo "tag_name=${tag_name}" >> "${GITHUB_OUTPUT}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ Manual version tags (`v*`) publish normal releases.
4848
Automatic release tags use this format:
4949

5050
```bash
51-
v0.0.<github_run_number>
51+
v0.1.<auto_increment_patch>
5252
```
5353

5454
Example prerelease page after a `main` push:
55-
- `https://github.com/apktdev/ticktick-cli/releases/tag/v0.0.123`
55+
- `https://github.com/apktdev/ticktick-cli/releases/tag/v0.1.12`
5656

5757
If you want a manual versioned release:
5858

0 commit comments

Comments
 (0)