Skip to content

Commit

Permalink
updating auto-bump gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rpmcginty committed Mar 5, 2024
1 parent 8246d3c commit 21b5e2f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
9 changes: 0 additions & 9 deletions .github/actions/bump-version-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ runs:
version_type=${{ steps.bump-version-tag.outputs.part }}
previous_version=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "major: $major"
echo "minor: $minor"
echo "patch: $patch"
echo "increment: $increment"
echo "version: $new_version"
echo "version_tag: $new_tag"
echo "version_type: $version_type"
echo "previous_version: $previous_version"
echo "major=$major" >> $GITHUB_OUTPUT
echo "minor=$minor" >> $GITHUB_OUTPUT
echo "patch=$patch" >> $GITHUB_OUTPUT
Expand Down
39 changes: 27 additions & 12 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version Info
run: |
echo "Major: ${{ steps.version-tag.outputs.major }}"
echo "Minor: ${{ steps.version-tag.outputs.minor }}"
echo "Patch: ${{ steps.version-tag.outputs.patch }}"
echo "Increment: ${{ steps.version-tag.outputs.increment }}"
echo "Version: ${{ steps.version-tag.outputs.version }}"
echo "Version Tag: ${{ steps.version-tag.outputs.version_tag }}"
echo "Version Type: ${{ steps.version-tag.outputs.version_type }}"
echo "Major: ${{ steps.version-tag.outputs.major }}"
echo "Minor: ${{ steps.version-tag.outputs.minor }}"
echo "Patch: ${{ steps.version-tag.outputs.patch }}"
echo "Increment: ${{ steps.version-tag.outputs.increment }}"
echo "Version: ${{ steps.version-tag.outputs.version }}"
echo "Version Tag: ${{ steps.version-tag.outputs.version_tag }}"
echo "Version Type: ${{ steps.version-tag.outputs.version_type }}"
echo "Previous Version: ${{ steps.version-tag.outputs.previous_version }}"
update-version-and-tag:
Expand All @@ -85,6 +85,16 @@ jobs:
with:
token: ${{ secrets.AI_PACKAGES_TOKEN }}
ssh_private_key: ${{ secrets.AIBSGITHUB_PRIVATE_KEY }}
- name: Print Version Info
run: |
echo "Major: ${{ needs.get-version-tag.outputs.major }}"
echo "Minor: ${{ needs.get-version-tag.outputs.minor }}"
echo "Patch: ${{ needs.get-version-tag.outputs.patch }}"
echo "Increment: ${{ needs.get-version-tag.outputs.increment }}"
echo "Version: ${{ needs.get-version-tag.outputs.version }}"
echo "Version Tag: ${{ needs.get-version-tag.outputs.version_tag }}"
echo "Version Type: ${{ needs.get-version-tag.outputs.version_type }}"
echo "Previous Version: ${{ needs.get-version-tag.outputs.previous_version }}"
- name: Update Version
env:
VERSION: ${{ needs.get-version-tag.outputs.version }}
Expand All @@ -93,8 +103,13 @@ jobs:
echo "${{ needs.get-version-tag.outputs.version }} (${{ needs.get-version-tag.outputs.version_tag }})"
echo "Updating version to ${{ env.VERSION }} (${{ env.VERSION_TAG }})"
find src -name '_version.py' -exec sed -i "s/__version__ = .*/__version__ = \"${{ env.VERSION }}\"/" {} \;
git add src/**/_version.py
git commit -m "Bump version to ${{ env.VERSION_TAG }}"
git tag -a ${{ env.VERSION_TAG }} -m "Release ${{ env.VERSION_TAG }}"
git push
git push --tags
if git diff-index --quiet HEAD --; then
echo "No changes detected. Version already ${{ env.VERSION }}. Skipping commit and tag."
else
echo "Changes detected."
git add src/**/_version.py
git commit -m "Bump version to ${{ env.VERSION_TAG }}"
git tag -a ${{ env.VERSION_TAG }} -m "Release ${{ env.VERSION_TAG }}"
git push
git push --tags
fi

0 comments on commit 21b5e2f

Please sign in to comment.