Skip to content

Commit

Permalink
Fix bugs with prepare release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TRoboto committed Nov 9, 2021
1 parent ca5be90 commit 0db1663
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

0 comments on commit 0db1663

Please sign in to comment.