Skip to content

Commit

Permalink
fix: correct missing script (#1754)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Butler <[email protected]>
  • Loading branch information
butler54 authored Dec 2, 2024
1 parent 4a7c123 commit 605c044
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docs-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
python-version: ${{ needs.set-versions.outputs.max }}
- id: versions
run: |
mike_version=$(python ./scripts/check-version.py ${{ env.GITHUB_REF }})
mike_version=$(python ./scripts/mike_version_parse.py ${{ env.GITHUB_REF }})
echo "mver=$mike_version" >> $GITHUB_OUTPUT
deploy-docs:
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions scripts/mike_version_parse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Parsing of tags for mike."""
import sys

if __name__ == '__main__':
assert len(sys.argv) == 2
revision = sys.argv[1]

components = revision.split('/')
assert len(components) == 3
if components[1] == 'heads' and components[2] == 'develop':
print('latest') # noqa: T201
sys.exit(0)
elif components[1] == 'tags' and components[2][0] == 'v':
versions = components[2][1:].split('.')
if 'rc' in components[2][1:]:
print(components[2][1:]) # noqa: T201
else:
print(f'{versions[0]}.{versions[1]}') # noqa: T201
sys.exit(0)

sys.exit(1)

0 comments on commit 605c044

Please sign in to comment.