Fix multiple changes to single file regression #38
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump the version on merge | |
on: | |
pull_request: | |
types: [closed] | |
branches: [master] | |
jobs: | |
version-hint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout the repository | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
- name: Setup Python and Git | |
uses: ./.github/actions/setup-python-and-git | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: | | |
python -m pip install . bump-my-version | |
- name: Generate the changelog and get the release hint | |
id: generate-changelog | |
run: | | |
RELEASE_KIND=$(generate-changelog --output release-hint) | |
echo "::notice::Suggested release type for this branch is: ${RELEASE_KIND}" | |
echo "RELEASE_KIND=$RELEASE_KIND" >> $GITHUB_ENV | |
echo "release-kind=$RELEASE_KIND" >> $GITHUB_OUTPUT | |
echo "PACKAGE=false" >> $GITHUB_ENV | |
- name: Bump version | |
if: ${{ env.RELEASE_KIND != 'no-release' }} | |
shell: bash | |
run: | | |
PR_NUMBER=$(gh pr view --json number -q .number || echo "") | |
REVISION=$(git describe --tags --long | awk -F- '{print $2}') | |
export PR_NUMBER REVISION | |
case "$RELEASE_KIND" in | |
major|minor|patch) | |
bump-my-version bump --allow-dirty --verbose "$RELEASE_KIND" | |
git push | |
git push --tags | |
echo "PACKAGE=true" >> $GITHUB_ENV | |
;; | |
dev) | |
echo "Intentionally not bumping version for dev release" | |
;; | |
esac | |
- name: Package | |
if: ${{ env.PACKAGE == 'true' }} | |
uses: hynek/build-and-inspect-python-package@v1 |