Skip to content

Commit

Permalink
Replace dynamically version number using the git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuet committed Sep 13, 2022
1 parent d2a9854 commit 3c42105
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Get version number from tag
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/"
VERSION=${TAG_NAME/v/} # stripping "v"
echo ::set-output name=VERSION::${VERSION}
- name: Set proper version in package __init__.py (used also by setup.py)
run: sed -e "s/^__version__\s*=.*$/__version__ = ${VERSION}/g" workflow_testing/__init__.py
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
- name: install build dependencies
run: pip install -U setuptools wheel
- name: Build workflow-testing wheel
Expand Down

0 comments on commit 3c42105

Please sign in to comment.