Skip to content

Commit

Permalink
limit to semantic version tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Hebrank committed Jan 18, 2023
1 parent 8a3136d commit 7345dba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: [push, pull_request]
on:
push:
tags:
- '*.*.*'

jobs:
publish:
Expand All @@ -11,9 +14,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
run: |
# from refs/tags/1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/##')
VERSION=$( basename $GITHUB_REF )
PLACEHOLDER='version="develop"'
VERSION_FILE='setup.py'
# fail out if placeholder not found
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/$PLACEHOLDER/version=\"${VERSION}\"/" "$VERSION_FILE"
shell: bash
Expand Down

0 comments on commit 7345dba

Please sign in to comment.