Skip to content

Commit

Permalink
Add backend version to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
dsbilling committed Jan 10, 2025
1 parent 0418aec commit 47a1e9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Update version in backend/config.py
run: |
cd backend
sed -i "s/API_DOCS_VERSION = '.*'/API_DOCS_VERSION = '${{ github.event.release.tag_name }}'/g" config.py
echo ${{ github.event.release.tag_name }} > .version
cd ..
- name: Update changelog
Expand Down
1 change: 1 addition & 0 deletions backend/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0-alpha.4
5 changes: 5 additions & 0 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ class Config:
# API Docs
API_DOCS_TITLE: str = f'{MICRO_SERVICE_NAME_FOR_HUMANS} API'
API_DOCS_VERSION: str = '3.0.0-alpha.1'
try:
with open('.version', 'r') as version_file:
API_DOCS_VERSION: str = version_file.read().strip()
except Exception as e:
logging.error(f'Error reading version file: {e}')
API_DOCS_DESCRIPTION: str = f'Endpoints for the {MICRO_SERVICE_NAME_FOR_HUMANS}'
API_DOCS_OPENAPI_URL: Optional[str] = None if MICRO_SERVICE_IN_PRODUCTION else '/openapi.json'
API_DOCS_URL: str = '/docs'
Expand Down

0 comments on commit 47a1e9d

Please sign in to comment.