Skip to content

Commit 901d3a1

Browse files
authored
build on push (#2443)
* updated workflow,uncomment to let it build on push * not build * dont generate a new tag * remove main
1 parent d958bb1 commit 901d3a1

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

.github/workflows/auto-tag-and-release.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Auto Tag and Release
22

33
on:
4-
# Temporarily manual-only for testing
5-
# Uncomment 'push' below to enable automatic tagging on merge
6-
# push:
7-
# branches:
8-
# - develop
9-
# - main
4+
push:
5+
branches:
6+
- develop
107
workflow_dispatch:
118
inputs:
129
force_services:
@@ -102,23 +99,27 @@ jobs:
10299
- name: Calculate new versions
103100
id: versions
104101
run: |
105-
# Function to get latest tag and bump patch version
102+
# Function to get latest tag and bump build number (4th digit)
106103
get_next_version() {
107104
local prefix=$1
108105
local latest_tag=$(git tag -l "${prefix}/v*" | sort -V | tail -n1)
109106
110107
if [ -z "$latest_tag" ]; then
111-
# No tags exist, start with v0.1.0
112-
echo "v0.1.0"
113-
else
114-
# Extract version and bump patch
115-
local version=${latest_tag##*/v}
116-
local major=$(echo $version | cut -d. -f1)
117-
local minor=$(echo $version | cut -d. -f2)
118-
local patch=$(echo $version | cut -d. -f3)
119-
local new_patch=$((patch + 1))
120-
echo "v${major}.${minor}.${new_patch}"
108+
# No tags exist - fail fast
109+
echo "ERROR: No existing tags found for prefix '${prefix}'. Please create an initial tag first." >&2
110+
echo "Example: git tag ${prefix}/v0.1.0.0 && git push origin ${prefix}/v0.1.0.0" >&2
111+
exit 1
121112
fi
113+
114+
# Extract version and bump build number (4th digit)
115+
local version=${latest_tag##*/v}
116+
local major=$(echo $version | cut -d. -f1)
117+
local minor=$(echo $version | cut -d. -f2)
118+
local patch=$(echo $version | cut -d. -f3)
119+
local build=$(echo $version | cut -d. -f4)
120+
121+
local new_build=$((build + 1))
122+
echo "v${major}.${minor}.${patch}.${new_build}"
122123
}
123124
124125
# Calculate versions for each service

0 commit comments

Comments
 (0)