6262 with :
6363 fetch-depth : 0
6464 ref : dev
65- token : ${{ secrets.GITHUB_TOKEN }}
65+ token : ${{ secrets.GH_PAT }}
6666
6767 - name : Set up Python
6868 uses : actions/setup-python@v5
@@ -86,21 +86,34 @@ jobs:
8686 id : version
8787 run : |
8888 set -e
89+
90+ # Fetch all tags to ensure we have the complete tag history
91+ git fetch --tags
92+
8993 CURRENT_VERSION=$(python -c "from datafog.__about__ import __version__; print(__version__)")
9094 echo "Current version: $CURRENT_VERSION"
9195
96+ # Extract base version (remove any alpha/beta suffix)
9297 if [[ $CURRENT_VERSION == *"b"* ]]; then
9398 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))"
9699 elif [[ $CURRENT_VERSION == *"a"* ]]; then
97100 BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
98- BETA_VERSION="${BASE_VERSION}b1"
99101 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
102103 fi
103104
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+
104117 echo "beta_version=$BETA_VERSION" >> $GITHUB_OUTPUT
105118 sed -i "s/__version__ = \".*\"/__version__ = \"$BETA_VERSION\"/" datafog/__about__.py
106119 sed -i "s/version=\".*\"/version=\"$BETA_VERSION\"/" setup.py
@@ -126,9 +139,9 @@ jobs:
126139 echo "Running integration tests..."
127140 python run_tests.py -m integration --no-header
128141
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
132145
133146 - name : Build package
134147 run : |
@@ -137,7 +150,7 @@ jobs:
137150
138151 - name : Create GitHub release
139152 env :
140- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
153+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
141154 run : |
142155 BETA_VERSION="${{ steps.version.outputs.beta_version }}"
143156 git add datafog/__about__.py setup.py
@@ -169,7 +182,7 @@ jobs:
169182
170183 - name : Cleanup old betas
171184 env :
172- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
185+ GITHUB_TOKEN : ${{ secrets.GH_PAT }}
173186 run : |
174187 BETA_RELEASES=$(gh release list --limit 30 | grep b | tail -n +6 | cut -f3)
175188
0 commit comments