Skip to content

Commit 7a11cdb

Browse files
authored
Merge branch 'main' into generator-bot-11795536291/sqlserverflex
2 parents ca12994 + 5b42a38 commit 7a11cdb

File tree

10 files changed

+44
-6
lines changed

10 files changed

+44
-6
lines changed

.github/workflows/cd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ jobs:
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 }}"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 "[email protected]"
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

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ install:
88

99
install-dev:
1010
# install core
11-
pip install -e core;poetry install -C core --only dev --no-root
11+
pip install -e core && poetry install -C core --only dev --no-root
1212
# install services
1313
@for f in $(shell ls ${SERVICES_DIR}); do pip install -e ${SERVICES_DIR}/$${f};poetry install -C ${SERVICES_DIR}/$${f} --only dev --no-root; done
1414

1515
test:
1616
# test core
17-
cd core; pytest; cd ..;
17+
cd core && pytest && cd ..
1818
# test services
1919
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f}; sh -c 'pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..; done
2020

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.1a1"
3+
version = "0.0.1a"
44
authors = [
55
"STACKIT Developer Tools <[email protected]>",
66
]
File renamed without changes.

services/dns/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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+
"""

0 commit comments

Comments
 (0)