|
44 | 44 | echo "new-tag=true" >> $GITHUB_OUTPUT |
45 | 45 | fi |
46 | 46 |
|
47 | | - update-version-files: |
48 | | - needs: check-version |
49 | | - if: needs.check-version.outputs.new-tag == 'true' |
50 | | - runs-on: ubuntu-latest |
51 | | - steps: |
52 | | - - name: Checkout code |
53 | | - uses: actions/checkout@v4 |
54 | | - |
55 | | - - name: Update VERSION_INFO.txt |
56 | | - run: | |
57 | | - VERSION=${{ needs.check-version.outputs.version }} |
58 | | - sed -i "s/Version: .*/Version: $VERSION/" VERSION_INFO.txt |
59 | | - sed -i "s/Release Date: .*/Release Date: $(date -u '+%Y-%m-%d')/" VERSION_INFO.txt |
60 | 47 |
|
61 | | - - name: Update VERSION_QUICK_REFERENCE.txt |
62 | | - run: | |
63 | | - VERSION=${{ needs.check-version.outputs.version }} |
64 | | - sed -i "s/ 版本號: v.*/ 版本號: v$VERSION/" VERSION_QUICK_REFERENCE.txt |
65 | | - sed -i "s/ 發佈日期: .*/ 發佈日期: $(date -u '+%Y-%m-%d')/" VERSION_QUICK_REFERENCE.txt |
66 | | -
|
67 | | - - name: Update VERSION_RECORD.md |
68 | | - run: | |
69 | | - VERSION=${{ needs.check-version.outputs.version }} |
70 | | - sed -i "s/### Release v.*/### Release v$VERSION ($(date -u '+%Y-%m-%d'))/" VERSION_RECORD.md |
71 | | -
|
72 | | - - name: Update VERSION_MANIFEST.json |
73 | | - run: | |
74 | | - VERSION=${{ needs.check-version.outputs.version }} |
75 | | - python3 << 'EOF' |
76 | | - import json |
77 | | - from datetime import datetime |
78 | | - |
79 | | - with open('VERSION_MANIFEST.json', 'r', encoding='utf-8') as f: |
80 | | - data = json.load(f) |
81 | | - |
82 | | - if data['versions']: |
83 | | - data['versions'][0]['version'] = "${{ needs.check-version.outputs.version }}" |
84 | | - data['versions'][0]['compilationDate'] = datetime.now().strftime('%Y-%m-%d') |
85 | | - data['lastUpdated'] = datetime.now().isoformat() + 'Z' |
86 | | - |
87 | | - with open('VERSION_MANIFEST.json', 'w', encoding='utf-8') as f: |
88 | | - json.dump(data, f, indent=2, ensure_ascii=False) |
89 | | - EOF |
90 | | -
|
91 | | - - name: Commit version updates |
92 | | - run: | |
93 | | - git config user.name "GitHub Actions" |
94 | | - git config user.email "actions@github.com" |
95 | | - git add VERSION_*.txt VERSION_*.md VERSION_*.json |
96 | | - git commit -m "chore: Update version files to ${{ needs.check-version.outputs.version }}" || true |
97 | | -
|
98 | | - - name: Push changes |
99 | | - run: | |
100 | | - git push origin main || true |
101 | 48 |
|
102 | 49 | create-release: |
103 | 50 | needs: check-version |
@@ -137,11 +84,6 @@ jobs: |
137 | 84 | - ✅ All 29 Tests Pass (100%) |
138 | 85 | - ✅ Performance Optimized |
139 | 86 | |
140 | | - ## Documentation |
141 | | - - See [VERSION_RECORD.md](../../blob/main/VERSION_RECORD.md) for detailed information |
142 | | - - See [RELEASE_PERFORMANCE_REPORT.md](../../blob/main/RELEASE_PERFORMANCE_REPORT.md) for performance details |
143 | | - - See [VERSION_QUICK_REFERENCE.txt](../../blob/main/VERSION_QUICK_REFERENCE.txt) for quick reference |
144 | | - |
145 | 87 | ## What's New |
146 | 88 | View the [git log](../../compare/$(git describe --tags --abbrev=0 HEAD^)...v${{ needs.check-version.outputs.version }}) for changes in this release. |
147 | 89 | draft: false |
|
0 commit comments