Skip to content

Commit 3588afb

Browse files
revise pipeline
1 parent 56b7fef commit 3588afb

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.github/workflows/release-trigger.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,23 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- name: Push tag for each updated package
1414
run: |
15-
git config --global user.name "GitHub Action"
16-
git config --global user.email "[email protected]"
15+
git config --global user.name "SDK Releaser Bot"
16+
git config --global user.email "[email protected]"
1717
1818
for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
1919
if git diff HEAD~1..HEAD $file | grep "version ="; then
20-
dirpath=$(dirname $file)
21-
version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
22-
dirpath=$(dirname $file)
23-
relpath=${file#*/core|stackit/*}
24-
cleaned_version=$(echo "$version" | tr -d '" ')
25-
tag=$(echo "${dirpath}/${cleaned_version}")
26-
git tag -a $tag -m "Release $version"
27-
git push origin --tags
28-
else
29-
echo "No change in version found."
20+
version_changes=$(git diff HEAD~1..HEAD $file | grep "version =")
21+
splitted_version_changes=($(echo "$version_changes" | grep -oP '(?<=version = )[^ ]*'))
22+
# Check if all versions are equal
23+
if [ $(echo "${splitted_version_changes[@]}" | tr ' ' '\n' | sort -u | wc -l) -ne 1 ]; then
24+
dirpath=$(dirname $file)
25+
current_version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
26+
dirpath=$(dirname $file)
27+
relpath=${file#*/core|stackit/*}
28+
cleaned_version=$(echo "$current_version" | tr -d '" ')
29+
tag=$(echo "${dirpath}/${cleaned_version}")
30+
git tag -a $tag -m "Release $cleaned_version"
31+
git push origin tag $tag
32+
fi
3033
fi
3134
done

core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "stackit-core"
3-
version = "0.0.1a3"
3+
version = "0.0.1a"
44
authors = [
55
"STACKIT Developer Tools <[email protected]>",
66
]

services/dns/pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[tool.poetry]
22
name = "stackit-dns"
3-
4-
5-
version = "0.0.1a3"
3+
version = "0.0.1a"
64
authors = [
75
"stackit-dns <[email protected]>",
86
]

0 commit comments

Comments
 (0)