@@ -13,37 +13,42 @@ jobs:
1313 runs-on : ubuntu-22.04
1414
1515 steps :
16- - name : Checkout the specified ref
16+ - name : " Checkout the specified ref"
1717 uses : actions/checkout@v4
1818 with :
1919 ref : ${{ inputs.ref_name }}
20+ fetch-depth : 0 # Import all commit history and tag
2021
21- # Verify version consistency between tag and version.py
22- - name : Check version.py matches ref_name
22+ - name : " Build package"
23+ run : |
24+ ./ccex build
25+
26+ - name : " Check requested version (ref_name)"
2327 run : |
24- FILE_VERSION=$(python -c 'exec(open("version.py").read()); print(VERSION)')
2528 INPUT_REF="${{ inputs.ref_name }}"
2629 TAG_VERSION="${INPUT_REF#v}" # Strip leading 'v' from ref_name
2730
28- echo "VERSION in version.py: $FILE_VERSION"
31+ VERSION="$(versioningit)"
32+ CLEAN_VERSION="$(echo "$VERSION" | cut -d'.' -f1-3)"
33+
34+ echo "$CLEAN_VERSION"
35+
36+ echo "VERSION from prepared package: $CLEAN_VERSION"
2937 echo "VERSION from ref_name: $TAG_VERSION"
3038
31- if [ "$FILE_VERSION " != "$TAG_VERSION" ]; then
32- echo "::error::VERSION in version.py ($FILE_VERSION) does not match ref_name ($INPUT_REF)"
39+ if [ "$CLEAN_VERSION " != "$TAG_VERSION" ]; then
40+ echo "::error::VERSION($CLEAN_VERSION) of current package does not match your requested ref_name ($INPUT_REF)"
3341 exit 1
3442 fi
3543
36- - name : " Build package"
37- run : |
38- ./ccex build
39-
4044 - name : " Upload artifact"
4145 uses : actions/upload-artifact@v4
4246 with :
4347 name : " wheel"
4448 path : " ./dist/"
4549
4650 publish-to-pypi :
51+
4752 needs :
4853 - build-and-upload
4954 runs-on : ubuntu-22.04
0 commit comments