@@ -15,24 +15,20 @@ jobs:
1515 build_publish :
1616 runs-on : ubuntu-latest
1717 steps :
18- - uses : actions/checkout@v3
18+ - uses : actions/checkout@v4
1919
2020 - name : Set up Python
21- uses : actions/setup-python@v4
21+ uses : actions/setup-python@v5
2222 with :
23- python-version : 3.9
23+ python-version : " 3.11 "
2424
25- - name : Upgrade pip version
25+ - name : Install build dependencies
2626 run : |
27- python -m pip install -U pip
28-
29- - name : Install wheel
30- run : |
31- python -m pip install wheel
27+ python -m pip install -U pip build
3228
3329 - name : Build wheel and source distribution
3430 run : |
35- python setup.py bdist_wheel sdist
31+ python -m build
3632
3733 - name : Publish package to PyPI
3834 uses : pypa/gh-action-pypi-publish@master
@@ -42,16 +38,16 @@ jobs:
4238 packages_dir : ${{ github.workspace }}/dist
4339
4440 - name : Parse version
45- run : echo "version=$(python3 -c 'from autowrap.version import __version__ as v ; print("%d.%d.%d" % v )')" >> $GITHUB_OUTPUT
41+ run : echo "version=$(python3 -c 'from autowrap.version import __version__; print(__version__ )')" >> $GITHUB_OUTPUT
4642 id : version
4743
4844 - name : Create github release
49- uses : softprops/action-gh-release@v1
45+ uses : softprops/action-gh-release@v2
5046 id : create_release
5147 with :
5248 draft : false
5349 prerelease : false
54- release_name : ${{ steps.version.outputs.version }}
50+ name : ${{ steps.version.outputs.version }}
5551 tag_name : release/${{ steps.version.outputs.version }}
5652 body_path : CHANGELOG.md
5753 env :
6763 cat CHANGELOG.md >> HISTORY.md
6864 echo >> HISTORY.md
6965 rm CHANGELOG.md && echo "autowrap $NEXT_VER" > CHANGELOG.md
70- sed -i -e "s/^[[:space:]]*__version__.*/__version__ = \(${NEXT_VER//./, }\)/g" autowrap/version.py
66+ # Update string version
67+ sed -i -e "s/^__version__ = \".*\"/__version__ = \"$NEXT_VER\"/g" autowrap/version.py
68+ # Update tuple version for backward compatibility
69+ TUPLE_VER=$(echo $NEXT_VER | sed 's/\./, /g')
70+ sed -i -e "s/^__version_tuple__ = (.*)/__version_tuple__ = ($TUPLE_VER)/g" autowrap/version.py
7171
7272 - uses : stefanzweifel/git-auto-commit-action@v4.15.2
7373 with :
0 commit comments