note: config version is 2.1
In my workflows, I have filters applied to determine which jobs are ran. I want a publish job (seen below) to only run when a tag is pushed. I had this working before on a much simpler regex, but wanted a comprehensive regexp for semver. We may make tags like v1-preview
, 0.0.1
, 0.0.1-preview
, etc. It validates fine using circleci config validate
, and the regexp works great on regexr.com. I was led to believe this regexp would be compatible with circleci since I got it from a CircleCI blog article.
Note, the following snippet is actually the “compiled” 2.0 configuration that I got from within circleci’s configuration tab.
- Publish to MavenCentral:
filters:
tags:
only: /(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/
branches:
ignore: /.*/
requires:
- Build
context: pi
The original 2.1 is below, where I’m utilizing a scalar var:
- 'Publish to MavenCentral':
context: pi
requires:
- 'Dependencies'
filters:
tags:
only: *semVerRegExp # allow publish tag matches any semVer
branches:
ignore: /.*/ # ignore all branch builds
Is my regexp unsupported or have I done something obviously wrong?