Skip to content

Commit c5accc8

Browse files
committed
chore(ci): switch release workflow from CalVer to SemVer
1 parent a4c4cca commit c5accc8

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'CalVer version (e.g. 2026.0.0)'
7+
description: 'SemVer version (e.g. 1.0.0)'
88
required: true
99
type: string
1010
push:
1111
tags:
12-
- '[0-9][0-9][0-9][0-9].*'
12+
- 'v[0-9]*'
13+
- '[0-9]*'
1314

1415
permissions:
1516
contents: read
@@ -35,10 +36,12 @@ jobs:
3536
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
3637
fi
3738
38-
- name: Validate CalVer format
39+
- name: Validate SemVer format
3940
run: |
40-
if ! echo "${{ steps.version.outputs.tag }}" | grep -qE '^[0-9]{4}\.[0-9]+\.[0-9]+$'; then
41-
echo "Error: Version must be in CalVer format YYYY.MINOR.PATCH (e.g. 2026.0.0)"
41+
VERSION="${{ steps.version.outputs.tag }}"
42+
VERSION="${VERSION#v}"
43+
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
44+
echo "Error: Version must be in SemVer format MAJOR.MINOR.PATCH (e.g. 1.0.0)"
4245
exit 1
4346
fi
4447
@@ -51,7 +54,7 @@ jobs:
5154
- name: Get previous tag
5255
id: previous
5356
run: |
54-
PREVIOUS=$(git tag --sort=-v:refname | grep -E '^[0-9]{4}\.' | grep -v "^${{ steps.version.outputs.tag }}$" | head -1)
57+
PREVIOUS=$(git tag --sort=-v:refname | grep -v "^${{ steps.version.outputs.tag }}$" | head -1)
5558
echo "tag=$PREVIOUS" >> "$GITHUB_OUTPUT"
5659
5760
- name: Generate changelog

0 commit comments

Comments
 (0)