Skip to content

Commit c11d129

Browse files
committed
Add automatic copyright year update script and integrate with CI/CD
1 parent 2df6d99 commit c11d129

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626
restore-keys: |
2727
mkdocs-material-
2828
- run: pip install -r requirements.txt
29+
- name: Update copyright year
30+
run: python update_year.py
2931
- run: mkdocs gh-deploy --force

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ site_name: glTF and glb Importer for Maya - Documentation
22
site_url: https://parashivbrl.github.io/gltf-glb-importer-for-maya-docs/
33
site_description: Complete documentation for importing glTF and glb files into Autodesk Maya. Import 3D models, materials, animations, and textures with this powerful Maya plugin.
44
site_author: Parashivamurthy B N
5-
copyright: 2025 glTF/glb Importer for Maya
5+
copyright: 2026 glTF/glb Importer for Maya
66

77
nav:
88
- Home: index.md

update_year.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Script to automatically update the copyright year in mkdocs.yml
4+
"""
5+
import re
6+
from datetime import datetime
7+
8+
def update_copyright_year():
9+
"""Update the copyright year in mkdocs.yml to the current year"""
10+
current_year = datetime.now().year
11+
mkdocs_file = 'mkdocs.yml'
12+
13+
try:
14+
with open(mkdocs_file, 'r', encoding='utf-8') as f:
15+
content = f.read()
16+
17+
# Replace the copyright year with current year
18+
# Pattern matches: copyright: YYYY glTF Importer for Maya
19+
pattern = r'copyright:\s*\d{4}\s+glTF Importer for Maya'
20+
replacement = f'copyright: {current_year} glTF Importer for Maya'
21+
22+
updated_content = re.sub(pattern, replacement, content)
23+
24+
if updated_content != content:
25+
with open(mkdocs_file, 'w', encoding='utf-8') as f:
26+
f.write(updated_content)
27+
print(f"Updated copyright year to {current_year} in {mkdocs_file}")
28+
else:
29+
print(f"Copyright year is already {current_year}")
30+
31+
except FileNotFoundError:
32+
print(f"Error: {mkdocs_file} not found")
33+
except Exception as e:
34+
print(f"Error updating copyright year: {e}")
35+
36+
if __name__ == '__main__':
37+
update_copyright_year()
38+

0 commit comments

Comments
 (0)