diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89e6245b..e89966e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,48 +52,58 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }} run: | - git config --global user.name 'Eugenio Parodi - Action' - git config --global user.email 'ceccopierangioliegenio@googlemail.com' - git clone \ - -b ${{ fromJson(steps.release-please.outputs.pr).headBranchName }} \ - https://${GITHUB_TOKEN}@github.com/ceccopierangiolieugenio/pyTermTk.git \ - pyTermTk.new + echo '::group::Setup Git' + git config --global user.name 'Eugenio Parodi - Action' + git config --global user.email 'ceccopierangioliegenio@googlemail.com' + git clone \ + -b ${{ fromJson(steps.release-please.outputs.pr).headBranchName }} \ + https://${GITHUB_TOKEN}@github.com/ceccopierangiolieugenio/pyTermTk.git \ + pyTermTk.new + echo '::endgroup::' + cd pyTermTk.new - # Update version in the project - _VERSION_TTK=$(jq .libs/pyTermTk .release-please-manifest.json) - _VERSION_DPT=$(jq .apps/dumbPaintTool .release-please-manifest.json) - _VERSION_T_D=$(jq .apps/ttkDesigner .release-please-manifest.json) - echo "Version TermTk: ${_VERSION_TTK}" - echo "Version dumbPaintTool: ${_VERSION_DPT}" - echo "Version ttkDesigner: ${_VERSION_T_D}" - sed -i \ - "s|__version__:str.*|__version__:str = ${_VERSION_TTK}|" \ - libs/pyTermTk/TermTk/__init__.py - sed -i \ - "s|__version__:str.*|__version__:str = ${_VERSION_TTK}|" \ - apps/dumbPaintTool/dumbPaintTool/__init__.py - sed -i \ - "s|__version__:str.*|__version__:str = ${_VERSION_T_D}|" \ - apps/ttkDesigner/ttkDesigner/__init__.py - - # Update required version in any pyproject.toml - # that depend on pyTermTk - find . -name pyproject.toml | - xargs sed -i \ - "s|'pyTermTk >= [^']*'|'pyTermTk >= ${_VERSION_TTK}'|" - - git add \ - libs/pyTermTk/TermTk/TTkCore/cfg.py \ - apps/dumbPaintTool/dumbPaintTool/__init__.py \ - apps/ttkDesigner/ttkDesigner/__init__.py \ - libs/pyTermTk/TermTk/__init__.py \ - CHANGELOG.md - find . -name pyproject.toml | - xargs git add - - git commit -m "chore: updated TermTk and apps to versions to ${_VERSION_TTK}, ${_VERSION_DPT}, ${_VERSION_T_D}" - git push + echo '::group::Retrieve the Versions' + # Update version in the project + _VERSION_TTK=$(jq '.["libs/pyTermTk"]' .release-please-manifest.json) + _VERSION_DPT=$(jq '.["apps/dumbPaintTool"]' .release-please-manifest.json) + _VERSION_T_D=$(jq '.["apps/ttkDesigner"]' .release-please-manifest.json) + echo "Version TermTk: ${_VERSION_TTK}" + echo "Version dumbPaintTool: ${_VERSION_DPT}" + echo "Version ttkDesigner: ${_VERSION_T_D}" + echo '::endgroup::' + + echo '::group::Update the Versions' + sed -i \ + "s|__version__:str.*|__version__:str = ${_VERSION_TTK}|" \ + libs/pyTermTk/TermTk/__init__.py + sed -i \ + "s|__version__:str.*|__version__:str = ${_VERSION_TTK}|" \ + apps/dumbPaintTool/dumbPaintTool/__init__.py + sed -i \ + "s|__version__:str.*|__version__:str = ${_VERSION_T_D}|" \ + apps/ttkDesigner/ttkDesigner/__init__.py + + # Update required version in any pyproject.toml + # that depend on pyTermTk + find . -name pyproject.toml | + xargs sed -i \ + "s|'pyTermTk >= [^']*'|'pyTermTk >= ${_VERSION_TTK}'|" + echo '::endgroup::' + + echo '::group::Push the Versions' + git add \ + libs/pyTermTk/TermTk/TTkCore/cfg.py \ + apps/dumbPaintTool/dumbPaintTool/__init__.py \ + apps/ttkDesigner/ttkDesigner/__init__.py \ + libs/pyTermTk/TermTk/__init__.py \ + CHANGELOG.md + find . -name pyproject.toml | + xargs git add + + git commit -m "chore: updated TermTk and apps to versions to ${_VERSION_TTK}, ${_VERSION_DPT}, ${_VERSION_T_D}" + git push + echo '::endgroup::' pyTermTk-deploy-artifacts: if: ${{ fromJson(needs.release-please.outputs.rp_out)['TermTk--release_created'] }}