Skip to content

Commit

Permalink
Get correct version on release in Conan packaging
Browse files Browse the repository at this point in the history
$GITHUB_REF starts with refs/tags/, which we need to remove.
Additionally, our versioning convention is to start versions with a v,
which prefix needs to be removed.
  • Loading branch information
Quincunx271 committed Dec 8, 2020
1 parent 1d3fa73 commit fe33ec5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ jobs:
shell: python
run: |
import os
import re
if '${{ github.event_name }}' == 'release':
print('::set-output name=CONAN_VERSION::' + os.environ['GITHUB_REF'])
ref = os.environ['GITHUB_REF']
assert ref.startswith('refs/tags/v')
version = ref[len('refs/tags/v'):]
assert re.match(r'\d+\.\d+\.\d+', version)
print('::set-output name=CONAN_VERSION::' + version)
print('::set-output name=CONAN_CHANNEL::stable')
else:
assert '${{ github.event_name }}' == 'push'
Expand Down

0 comments on commit fe33ec5

Please sign in to comment.