Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct missing script #1754

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
23 changes: 23 additions & 0 deletions scripts/mike_version_parse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python
"""Parsing of tags for mike."""
import os
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
os.exit(0)
butler54 marked this conversation as resolved.
Show resolved Hide resolved
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
os.exit(0)
butler54 marked this conversation as resolved.
Show resolved Hide resolved

os.exit(1)
butler54 marked this conversation as resolved.
Show resolved Hide resolved
Loading