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 3131 - name : Build & Publish to PyPi
3232 run : |
3333 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 11[tool .poetry ]
22name = " stackit-core"
3- version = " 0.0.1a1 "
3+ version = " 0.0.1a "
44authors = [
55 " STACKIT Developer Tools <developer-tools@stackit.cloud>" ,
66]
Original file line number Diff line number Diff line change @@ -102,4 +102,4 @@ per-file-ignores = """
102102 # E501: long descriptions/string values might lead to lines that are too long
103103 # B028: stacklevel for deprecation warning is irrelevant
104104 ./src/stackit/*/api/default_api.py: F841,B028,E501
105- """
105+ """
You can’t perform that action at this time.
0 commit comments