Skip to content

Commit

Permalink
Improve tag RegEx
Browse files Browse the repository at this point in the history
  • Loading branch information
orome committed Nov 5, 2023
1 parent 54261df commit ac57b2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ defaults:
run:
shell: bash

env:
# regexr.com/7mmq7
TAG_REGEX: '^v(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))((a|b|rc)(0|[1-9][0-9]*))?(\.(dev|post)(0|[1-9][0-9]*))?$'
DEV_TAG_REGEX: '\.(dev|post)(0|[1-9][0-9]*)$'

jobs:

test:
Expand Down Expand Up @@ -78,9 +83,8 @@ jobs:
id: validate
run: |
# regexr.com/7mmq7
TAG_REGEX='^v(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))((a|b|rc)[1-9][0-9]+)?(\.(dev|post)[1-9][0-9]*)?$'
DEV_TAG_REGEX='\.(dev|post)[1-9][0-9]*$'
TAG_REGEX="${{ env.TAG_REGEX }}"
DEV_TAG_REGEX="${{ env.DEV_TAG_REGEX }}"
TAG_NAME=${GITHUB_REF#refs/tags/}
PACKAGE_VERSION=${{ needs.test.outputs.PACKAGE_VERSION }}
Expand Down
3 changes: 2 additions & 1 deletion automata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# __author__ = 'Roy Levien' ;

# See - http://www.python.org/dev/peps/pep-0440/
# ^v(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))((a|b|rc)[1-9][0-9]+)?(\.(dev|post)[1-9][0-9]*)?$
# ^v(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))((a|b|rc)(0|[1-9][0-9]*))?(\.(dev|post)(0|[1-9][0-9]*))?$
# regexr.com/7mmq7
# USE -
# See - https://py-pkgs.org/07-releasing-versioning.html#version-numbering
__release__ = '0.1' # N(.N)*
# USE - To indicate status of release, can be on any branch
__pre_release__ = 'a3' # aN | bN | rcN
Expand Down

0 comments on commit ac57b2d

Please sign in to comment.