62
62
with :
63
63
fetch-depth : 0
64
64
ref : dev
65
- token : ${{ secrets.GITHUB_TOKEN }}
65
+ token : ${{ secrets.GH_PAT }}
66
66
67
67
- name : Set up Python
68
68
uses : actions/setup-python@v5
@@ -86,21 +86,34 @@ jobs:
86
86
id : version
87
87
run : |
88
88
set -e
89
+
90
+ # Fetch all tags to ensure we have the complete tag history
91
+ git fetch --tags
92
+
89
93
CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
90
94
echo "Current version: $CURRENT_VERSION"
91
95
96
+ # Extract base version (remove any alpha/beta suffix)
92
97
if [[ $CURRENT_VERSION == *"b"* ]]; then
93
98
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'b' -f1)
94
- BETA_NUM=$(echo $CURRENT_VERSION | cut -d'b' -f2)
95
- BETA_VERSION="${BASE_VERSION}b$((BETA_NUM + 1))"
96
99
elif [[ $CURRENT_VERSION == *"a"* ]]; then
97
100
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
98
- BETA_VERSION="${BASE_VERSION}b1"
99
101
else
100
- BASE_VERSION=$(python3 -c "import sys; version='$CURRENT_VERSION'; parts=version.split('.'); parts[1]=str(int(parts[1])+1); parts[2]='0'; print('.'.join(parts))")
101
- BETA_VERSION="${BASE_VERSION}b1"
102
+ BASE_VERSION=$CURRENT_VERSION
102
103
fi
103
104
105
+ echo "Base version: $BASE_VERSION"
106
+
107
+ # Find the next available beta version by checking existing tags
108
+ BETA_NUM=1
109
+ while git tag -l "v${BASE_VERSION}b${BETA_NUM}" | grep -q "v${BASE_VERSION}b${BETA_NUM}"; do
110
+ echo "Tag v${BASE_VERSION}b${BETA_NUM} already exists"
111
+ BETA_NUM=$((BETA_NUM + 1))
112
+ done
113
+
114
+ BETA_VERSION="${BASE_VERSION}b${BETA_NUM}"
115
+ echo "Next available beta version: $BETA_VERSION"
116
+
104
117
echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
105
118
sed -i "s/__version__ = \".*\"/__version__ = \"$BETA_VERSION\"/" datafog/__about__.py
106
119
sed -i "s/version=\".*\"/version=\"$BETA_VERSION\"/" setup.py
@@ -126,9 +139,9 @@ jobs:
126
139
echo "Running integration tests..."
127
140
python run_tests.py -m integration --no-header
128
141
129
- # Run benchmark tests with optimal performance (no memory debugging )
130
- echo "Running benchmark tests with performance optimizations ..."
131
- OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python -m pytest tests/benchmark_text_service .py -v --no-header --benchmark-skip
142
+ # Run simple performance validation (no pytest-benchmark dependency )
143
+ echo "Running simple performance validation ..."
144
+ OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python tests/simple_performance_test .py
132
145
133
146
- name : Build package
134
147
run : |
@@ -137,7 +150,7 @@ jobs:
137
150
138
151
- name : Create GitHub release
139
152
env :
140
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153
+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
141
154
run : |
142
155
BETA_VERSION="${{ steps.version.outputs.beta_version }}"
143
156
git add datafog/__about__.py setup.py
@@ -169,7 +182,7 @@ jobs:
169
182
170
183
- name : Cleanup old betas
171
184
env :
172
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185
+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
173
186
run : |
174
187
BETA_RELEASES=$(gh release list --limit 30 | grep b | tail -n +6 | cut -f3)
175
188
0 commit comments