diff --git a/.github/workflows/cpp-python-build.yml b/.github/workflows/cpp-python-build.yml index 5385e952ca..b91958dd9e 100644 --- a/.github/workflows/cpp-python-build.yml +++ b/.github/workflows/cpp-python-build.yml @@ -659,6 +659,7 @@ jobs: find . -type f -name *.whl -exec cp {} dist/. \; find . -type f -name *.deb -exec cp {} dist/. \; find . -type f -name *.tar.gz -exec cp {} dist/. \; + find . -type f -name MSVC_version.txt -exec cp {} . \; # PyPI deployment - name: Set up Python 3.7 @@ -718,14 +719,18 @@ jobs: run: | # Increment the value of PROJECT_VERSION_PATCH sed -ri 's/(set\(PROJECT_VERSION_PATCH\s\")([0-9]+)(.*)/echo "\1\\"$((\2+1))\\"\3"/ge' CMakeLists.txt + # Extract from CMake the project version number at the next release. + echo "message(STATUS \"JSBSIM_VERSION:\${PROJECT_VERSION}\")" >> src/CMakeLists.txt + export FUTURE_VERSION=`cmake . | grep JSBSIM_VERSION | awk -F':' '{print $2}'` + # Extract the project old version number + export OLD_VERSION=`egrep 'JSBSim-([0-9]+\.)+[0-9]+-setup.exe' README.md | awk -F'JSBSim-' '{ print $2}' | awk -F'-setup.exe' '{ print $1}'` + echo "OLD_VERSION=$OLD_VERSION" >> $GITHUB_ENV # Update references to the current stable version in README.md - export PREV_VERSION=`egrep 'JSBSim-([0-9]+\.)+[0-9]+-setup.exe' README.md | awk -F'JSBSim-' '{ print $2}' | awk -F'-setup.exe' '{ print $1}'` - sed -ri 's/_'"$PREV_VERSION"'-[0-9]+.amd64.deb/_'"$VERSION"'-'"$GITHUB_RUN_NUMBER"'.amd64.deb/g' README.md - sed -ri 's/'"$PREV_VERSION"'/'"$VERSION"'/g' README.md - sed -ri 's/'"$PREV_VERSION"'/'"$VERSION"'/g' matlab/README.md + sed -ri 's/_'"$OLD_VERSION"'-[0-9]+.amd64.deb/_'"$VERSION"'-'"$GITHUB_RUN_NUMBER"'.amd64.deb/g' README.md + sed -ri 's/'"$OLD_VERSION"'/'"$VERSION"'/g' README.md + sed -ri 's/'"$OLD_VERSION"'/'"$VERSION"'/g' matlab/README.md # Update the MSVC project files. - sed -ri 's/JSBSIM_VERSION="$PREV_VERSION"/JSBSIM_VERSION="$VERSION"/g' JSBSim.vcxproj - sed -ri 's/JSBSIM_VERSION="$PREV_VERSION"/JSBSIM_VERSION="$VERSION"/g' JSBSimForUnreal.vcxproj + sed -ri 's/JSBSIM_VERSION=".*"/JSBSIM_VERSION="'$FUTURE_VERSION'"/g' JSBSim.vcxproj # Update the MSVC version sed -ri 's/Visual Studio\s[A-Za-z0-9 ]+\s\(build\s[0-9.]+\)/'"$MSVC_VERSION"'/g' matlab/README.md # Determine the branch name @@ -734,7 +739,7 @@ jobs: git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git checkout $BRANCH_NAME - git commit -m "Bump version" CMakeLists.txt README.md matlab/README.md + git commit -m "Bump version" CMakeLists.txt README.md matlab/README.md JSBSim.vcxproj git push origin $BRANCH_NAME # Bump stable version of the `master` branch @@ -747,10 +752,9 @@ jobs: working-directory: _master run: | # Update references to the current stable version in README.md - export PREV_VERSION=`egrep 'JSBSim-([0-9]+\.)+[0-9]+-setup.exe' README.md | awk -F'JSBSim-' '{ print $2}' | awk -F'-setup.exe' '{ print $1}'` - sed -ri 's/_'"$PREV_VERSION"'-[0-9]+.amd64.deb/_'"$VERSION"'-'"$GITHUB_RUN_NUMBER"'.amd64.deb/g' README.md - sed -ri 's/'"$PREV_VERSION"'/'"$VERSION"'/g' README.md - sed -ri 's/'"$PREV_VERSION"'/'"$VERSION"'/g' matlab/README.md + sed -ri 's/_'"$OLD_VERSION"'-[0-9]+.amd64.deb/_'"$VERSION"'-'"$GITHUB_RUN_NUMBER"'.amd64.deb/g' README.md + sed -ri 's/'"$OLD_VERSION"'/'"$VERSION"'/g' README.md + sed -ri 's/'"$OLD_VERSION"'/'"$VERSION"'/g' matlab/README.md # Update the MSVC version sed -ri 's/Visual Studio\s[A-Za-z0-9 ]+\s\(build\s[0-9.]+\)/'"$MSVC_VERSION"'/g' matlab/README.md git commit -m "Bump stable release version" README.md matlab/README.md @@ -770,7 +774,7 @@ jobs: with: python-version: '3.7' - name: Install Python packages - run: pip install -U numpy sphinx + run: pip install -U numpy sphinx cython 'setuptools>=60.0.0' - name: Checkout JSBSim uses: actions/checkout@v2 - name: Configure JSBSim