Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcquade authored Jul 16, 2021
1 parent ea75e54 commit 572149e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,29 @@ jobs:
git add .
git commit -m "update brew formula" policy_sentry/bin/cli.py HomebrewFormula/policy_sentry.rb || echo "No brew changes to commit"
git push -u origin master
bump-version:
needs: update-brew
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master

- name: Bump version
run: |
version_file="policy_sentry/bin/version.py"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git fetch --tags
git pull origin master
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest tag: $latest_tag"
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
echo "new tag: $new_tag"
printf "# pylint: disable=missing-module-docstring\n__version__ = '$new_tag'""" > $version_file
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
git push origin

0 comments on commit 572149e

Please sign in to comment.