Skip to content

Commit

Permalink
Auto-bump package version in Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
amalmurali47 committed Jul 4, 2021
1 parent 13a4c09 commit ac2d79c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Auto-bump package version
run: |
# Get 1.2.3 from refs/tags/v1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
PLACEHOLDER='__version__ = "develop"'
VERSION_FILE='onaws/__init__.py'
# Ensure that placeholder exists. If grep doesn't find the placeholder,
# it exits with exit code 1 and GitHub Actions aborts the build
grep "$PLACEHOLDER" "$VERSION_FILE"
# Replace with actual version
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down

0 comments on commit ac2d79c

Please sign in to comment.