File tree Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 31
31
- name : Build & Publish to PyPi
32
32
run : |
33
33
pip install poetry
34
- cd $PACKAGE_PATH
35
- poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
34
+ cd $PACKAGE_PATH
35
+ poetry publish --build --username="__token__" --no-interaction --password="${{ secrets.PYPI_TOKEN }}"
Original file line number Diff line number Diff line change
1
+ name : Check Version Update
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ check-version :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - name : Push tag for each updated package
14
+ run : |
15
+ git config --global user.name "SDK Releaser Bot"
16
+ git config --global user.email "noreply@stackit.de"
17
+
18
+ for file in $(git diff --name-only HEAD~1..HEAD | grep pyproject.toml); do
19
+ # Extract the change regarding the version from the pyproject.toml file
20
+ version_changes=$(git diff HEAD~1..HEAD $file | grep "version =")
21
+ # Check if the extracted change is not empty
22
+ if [ -n "$version_changes" ]; then
23
+ # Split all found version changes, so we can compare the old and new version.
24
+ splitted_version_changes=($(echo "$version_changes" | grep -oP '(?<=version = )[^ ]*'))
25
+ # Only create a tag if there has been an actual change in the version, not just a format change.
26
+ if [ $(echo "${splitted_version_changes[@]}" | tr ' ' '\n' | sort -u | wc -l) -ne 1 ]; then
27
+ dirpath=$(dirname $file)
28
+ # Extract just the version number
29
+ current_version=$(grep -o "version = .*" ${file} | cut -d '=' -f 2-)
30
+ dirpath=$(dirname $file)
31
+ cleaned_version=$(echo "$current_version" | tr -d '" ')
32
+ # Create the tag based on the updated service and the new version
33
+ tag=$(echo "${dirpath}/${cleaned_version}")
34
+ git tag -a $tag -m "Release $cleaned_version"
35
+ git push origin tag $tag
36
+ fi
37
+ fi
38
+ done
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " stackit-core"
3
- version = " 0.0.1a1 "
3
+ version = " 0.0.1a "
4
4
authors = [
5
5
" STACKIT Developer Tools <developer-tools@stackit.cloud>" ,
6
6
]
Original file line number Diff line number Diff line change @@ -102,4 +102,4 @@ per-file-ignores = """
102
102
# E501: long descriptions/string values might lead to lines that are too long
103
103
# B028: stacklevel for deprecation warning is irrelevant
104
104
./src/stackit/*/api/default_api.py: F841,B028,E501
105
- """
105
+ """
You can’t perform that action at this time.
0 commit comments