|
23 | 23 | workflow_dispatch: # Allow manual triggering |
24 | 24 |
|
25 | 25 | jobs: |
26 | | - build-ctan-package: |
| 26 | + create-release: |
27 | 27 | runs-on: ubuntu-latest |
28 | 28 | timeout-minutes: 30 |
29 | 29 | permissions: |
|
63 | 63 | echo "PACKAGE_DATE=$PACKAGE_DATE" |
64 | 64 | } >> $GITHUB_ENV |
65 | 65 |
|
66 | | - # Also set as step output for GitHub Actions context |
67 | | - echo "package-version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT |
68 | 66 | else |
69 | 67 | # Default values if package.json doesn't exist |
70 | 68 | PACKAGE_VERSION="1.1.0" |
|
79 | 77 | echo "PACKAGE_DATE=$PACKAGE_DATE" |
80 | 78 | } >> $GITHUB_ENV |
81 | 79 |
|
82 | | - # Also set as step output for GitHub Actions context |
83 | | - echo "package-version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT |
84 | 80 | fi |
85 | 81 | # Extract year for copyright statements |
86 | 82 | echo "CURRENT_YEAR=$(date +%Y)" >> $GITHUB_ENV |
@@ -112,15 +108,12 @@ jobs: |
112 | 108 | fi |
113 | 109 | echo "All required source files validated successfully" |
114 | 110 |
|
115 | | - - name: Create class file |
| 111 | + - name: Copy class and configuration files |
116 | 112 | run: | |
117 | 113 | cp style/tongjithesis.cls ctan/tongjithesis/ || { |
118 | 114 | echo "Error: Failed to copy tongjithesis.cls" |
119 | 115 | exit 1 |
120 | 116 | } |
121 | | -
|
122 | | - - name: Create configuration file |
123 | | - run: | |
124 | 117 | cp style/tongjithesis.cfg ctan/tongjithesis/ || { |
125 | 118 | echo "Error: Failed to copy tongjithesis.cfg" |
126 | 119 | exit 1 |
@@ -230,7 +223,7 @@ jobs: |
230 | 223 |
|
231 | 224 | ## Documentation |
232 | 225 |
|
233 | | - For detailed documentation, please refer to the user guide (tongjithesis-guide.pdf). |
| 226 | + For detailed documentation, please refer to the README.md file and example files included in this package. |
234 | 227 |
|
235 | 228 | ## License |
236 | 229 |
|
@@ -562,56 +555,6 @@ jobs: |
562 | 555 | ctan/tongjithesis/ |
563 | 556 | retention-days: 90 |
564 | 557 |
|
565 | | - - name: Commit changes (only on manual dispatch) |
566 | | - if: github.event_name == 'workflow_dispatch' |
567 | | - run: | |
568 | | - git config --local user.email "github-actions[bot]@users.noreply.github.com" |
569 | | - git config --local user.name "github-actions[bot]" |
570 | | -
|
571 | | - # Copy the consolidated class file back to the main project |
572 | | - cp ctan/tongjithesis/tongjithesis.cls style/ || { |
573 | | - echo "Error: Failed to copy consolidated class file" |
574 | | - exit 1 |
575 | | - } |
576 | | -
|
577 | | - # Update main.tex to remove the .sty import if needed (only if pattern exists) |
578 | | - if grep -q '\\usepackage{tongjithesis}' main.tex; then |
579 | | - # Use portable sed with backup file |
580 | | - sed -i.bak 's/\\usepackage{tongjithesis}/% \\usepackage{tongjithesis} % No longer needed as functionality is integrated in the .cls file/' main.tex || { |
581 | | - echo "Warning: Failed to update main.tex, but continuing..." |
582 | | - } |
583 | | - # Remove backup file |
584 | | - rm -f main.tex.bak |
585 | | - else |
586 | | - echo "No \\usepackage{tongjithesis} found in main.tex, skipping sed replacement" |
587 | | - fi |
588 | | -
|
589 | | - # Check if there are any changes to commit |
590 | | - if git diff --quiet && git diff --cached --quiet; then |
591 | | - echo "No changes to commit" |
592 | | - exit 0 |
593 | | - fi |
594 | | -
|
595 | | - git add style/tongjithesis.cls main.tex || { |
596 | | - echo "Error: Failed to add files to git" |
597 | | - exit 1 |
598 | | - } |
599 | | -
|
600 | | - git commit -m "release: v$PACKAGE_VERSION update consolidated class file" || { |
601 | | - echo "Error: Failed to commit changes" |
602 | | - exit 1 |
603 | | - } |
604 | | -
|
605 | | - # Pull latest changes before pushing to avoid conflicts |
606 | | - CURRENT_BRANCH="${GITHUB_REF_NAME:-master}" |
607 | | - git pull --rebase origin "$CURRENT_BRANCH" || { |
608 | | - echo "Warning: Failed to pull latest changes from $CURRENT_BRANCH, attempting push anyway..." |
609 | | - } |
610 | | -
|
611 | | - git push || { |
612 | | - echo "Error: Failed to push changes" |
613 | | - exit 1 |
614 | | - } |
615 | 558 |
|
616 | 559 | - name: Download compiled PDFs from test workflow (only on manual dispatch) |
617 | 560 | if: github.event_name == 'workflow_dispatch' |
|
0 commit comments