Skip to content

Commit

Permalink
add manual again
Browse files Browse the repository at this point in the history
  • Loading branch information
savente93 committed Aug 8, 2023
1 parent d69c44d commit 664641e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/update_dev_version_manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---

name: Update Version
on:
workflow_dispatch:




jobs:
update-version:
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
repository: savente/automation-demo
GITHUB_TOKEN: ${{ secrets.HYDROMT_BOT_PAT }}
# - name: configure git
# run: |
# git config user.name "GitHub Actions Bot"
# git config user.email "<>"
- name: Calculate new dev version
run: |
DEV_VERSION=$(cat __init__.py | awk '/__version__/{print $0}' | awk -F'dev' '{print $2}' | tr -d '\"')
if [[ -z $DEV_VERSION ]]; then
echo "NEW_VERSION=.dev1" >> $GITHUB_ENV
else
echo "NEW_VERSION=.dev$(( $DEV_VERSION + 1))" >> $GITHUB_ENV
fi
- name: update version
env:
repository: savente/automation-demo
GITHUB_TOKEN: ${{ secrets.HYDROMT_BOT_PAT }}
# token: ${{ secrets.HYDROMT_BOT_PAT }}
run: |
git checkout main
sed -i "s/__version__\s*=\s*\"\([0-9]\+\.[0-9]\+\.[0-9]\+\).dev[0-9]\+\"/__version__ = \"\1$NEW_VERSION\"/" __init__.py
git add __init__.py
git commit -m "update version"
git push origin main

0 comments on commit 664641e

Please sign in to comment.