Skip to content

Commit 572149e

Browse files
authored
Update publish.yml
1 parent ea75e54 commit 572149e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,29 @@ jobs:
8888
git add .
8989
git commit -m "update brew formula" policy_sentry/bin/cli.py HomebrewFormula/policy_sentry.rb || echo "No brew changes to commit"
9090
git push -u origin master
91+
92+
bump-version:
93+
needs: update-brew
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v2
97+
with:
98+
ref: master
99+
100+
- name: Bump version
101+
run: |
102+
version_file="policy_sentry/bin/version.py"
103+
104+
git config --local user.email "action@github.com"
105+
git config --local user.name "GitHub Action"
106+
git fetch --tags
107+
git pull origin master
108+
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
109+
echo "latest tag: $latest_tag"
110+
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)}')
111+
echo "new tag: $new_tag"
112+
113+
printf "# pylint: disable=missing-module-docstring\n__version__ = '$new_tag'""" > $version_file
114+
115+
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
116+
git push origin

0 commit comments

Comments
 (0)