From 0db1663cbe412992bcaf2931c995ce7f8e5e7344 Mon Sep 17 00:00:00 2001 From: Mohammad Al-Fetyani Date: Tue, 9 Nov 2021 10:10:29 +0300 Subject: [PATCH] Fix bugs with prepare release workflow --- .github/workflows/prepare_release.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index f6cf8007..5fc62832 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -9,9 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set RELEASE_VERSION - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + run: echo "RELEASE_VERSION=$(git describe --tags | awk -F - '{print substr($1,2)}')" >> $GITHUB_ENV - name: Setup Python 3.8 uses: actions/setup-python@v2 @@ -32,24 +34,29 @@ jobs: chmod +x tools/gen_changelog.py poetry run tools/gen_changelog.py ${{ secrets.GITHUB_TOKEN }} v$CURRENT_VERSION v$RELEASE_VERSION - - name: Bump version + - name: Bump pypi version run: poetry version $RELEASE_VERSION - name: Create Pull Request + id: cpr uses: peter-evans/create-pull-request@v3 with: commit-message: prepare release - title: Prepare for the next release of Maha (v$RELEASE_VERSION) + title: Prepare for the next release of Maha (v${{ env.RELEASE_VERSION }}) branch: prepare-release base: main + token: ${{ secrets.GITHUB_TOKEN }} - - uses: tzkhan/pr-update-action@v2 + - name: Update Pull Request + uses: tzkhan/pr-update-action@v2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" + base-branch-regex: '[a-z\d-_.\\/]+' head-branch-regex: "prepare-release" body-template: | This is an auto-generated PR to prepare for the next release of Maha. The following changes were automatically made: - - Generated changelogs for release v$RELEASE_VERSION. See [changelog](https://maha--${{ steps.cpr.outputs.pull-request-number }}.org.readthedocs.build/en/${{ steps.cpr.outputs.pull-request-number }}/changelog/$RELEASE_VERSION-changelog.html) - - Bumped pypi version to v$RELEASE_VERSION. + - Generated changelogs for release v${{ env.RELEASE_VERSION }}. See [changelog](https://maha--${{ steps.cpr.outputs.pull-request-number }}.org.readthedocs.build/en/${{ steps.cpr.outputs.pull-request-number }}/changelog/${{ env.RELEASE_VERSION }}-changelog.html). + - Bumped pypi version to v${{ env.RELEASE_VERSION }}. - Updated the citation information. + body-update-action: "replace"