Skip to content

Commit

Permalink
feat: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
seblum committed Apr 13, 2024
1 parent 98823a4 commit 525e8a2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/actions/bump-docker-version/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Bump python package versions"
description: "Bumps versions of python packages if changes since a given commit are detected."
inputs:
ci_bot_email:
description: email to use as author of the commit
required: false
ci_bot_name:
description: Name to use as author of the commit
required: false
directory:
description: The directory in source to filter the python packages by
required: false
runs:
using: "composite"
steps:
-
name: Bump python package versions
shell: bash
if: github.event_name == 'pull_request'
run: |
if [ -z "${{ inputs.directory }}" ]; then
PY_PACKAGE_VERSION_UPDATES=$(bash ./scripts/bump_py_package_versions.sh --changed-since=${{ github.event.pull_request.base.sha }} --base-branch=${{ github.event.pull_request.base.ref }})
else
PY_PACKAGE_VERSION_UPDATES=$(bash ./scripts/bump_py_package_versions.sh --changed-since=${{ github.event.pull_request.base.sha }} --base-branch=${{ github.event.pull_request.base.ref }} --filter-address-regex=src/${{ inputs.directory }})
fi
if [ -z "$PY_PACKAGE_VERSION_UPDATES" ]; then
echo "No python package version changes detected."
else
echo "## Python package version changes detected:" >> pr-comment.txt
echo "$PY_PACKAGE_VERSION_UPDATES" >> pr-comment.txt
cat pr-comment.txt >> $GITHUB_STEP_SUMMARY
fi
-
name: Comment version changes on PR
if: ${{ hashFiles('pr-comment.txt') != '' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
path: pr-comment.txt
-
name: Commit and Push
if: ${{ hashFiles('pr-comment.txt') != '' }}
shell: bash
run: |
git checkout ${{ github.event.pull_request.head.ref }}
shopt -s globstar # enable recursive globbing
git config --global user.email ${{ inputs.ci_bot_email }}
git config --global user.name ${{ inputs.ci_bot_name }}
git add **/BUILD
git commit -m "chore: bump python package versions"
git push
3 changes: 3 additions & 0 deletions .github/actions/bump-docker-version/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bump Python Package Versions

A GitHub action that checks for Docker version updates and bumps the version number accordingly based on past commit messages.
8 changes: 8 additions & 0 deletions .github/workflows/build-and-push-to-dockerhub_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# -
# name: Bump python package versions
# if: github.event_name == 'pull_request'
# uses: ./.github/actions/bump-py-package-versions
# with:
# ci_bot_email: ${{ vars.CI_BOT_EMAIL }}
# ci_bot_name: ${{ vars.CI_BOT_NAME }}
# directory: ${{ matrix.directory }}
-
name: Login to DockerHub
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-to-dockerhub_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish docker CD

env:
DOCKERREPO: seblum/octivbooker
TAG: v1.4.2
TAG: v1.4.3

on:
push:
Expand Down

0 comments on commit 525e8a2

Please sign in to comment.