Skip to content

Commit 288f204

Browse files
committed
update: CI release
1 parent 28b845e commit 288f204

File tree

1 file changed

+3
-60
lines changed

1 file changed

+3
-60
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
workflow_dispatch: # Allow manual triggering
2424

2525
jobs:
26-
build-ctan-package:
26+
create-release:
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 30
2929
permissions:
@@ -63,8 +63,6 @@ jobs:
6363
echo "PACKAGE_DATE=$PACKAGE_DATE"
6464
} >> $GITHUB_ENV
6565
66-
# Also set as step output for GitHub Actions context
67-
echo "package-version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
6866
else
6967
# Default values if package.json doesn't exist
7068
PACKAGE_VERSION="1.1.0"
@@ -79,8 +77,6 @@ jobs:
7977
echo "PACKAGE_DATE=$PACKAGE_DATE"
8078
} >> $GITHUB_ENV
8179
82-
# Also set as step output for GitHub Actions context
83-
echo "package-version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
8480
fi
8581
# Extract year for copyright statements
8682
echo "CURRENT_YEAR=$(date +%Y)" >> $GITHUB_ENV
@@ -112,15 +108,12 @@ jobs:
112108
fi
113109
echo "All required source files validated successfully"
114110
115-
- name: Create class file
111+
- name: Copy class and configuration files
116112
run: |
117113
cp style/tongjithesis.cls ctan/tongjithesis/ || {
118114
echo "Error: Failed to copy tongjithesis.cls"
119115
exit 1
120116
}
121-
122-
- name: Create configuration file
123-
run: |
124117
cp style/tongjithesis.cfg ctan/tongjithesis/ || {
125118
echo "Error: Failed to copy tongjithesis.cfg"
126119
exit 1
@@ -230,7 +223,7 @@ jobs:
230223
231224
## Documentation
232225
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.
234227
235228
## License
236229
@@ -562,56 +555,6 @@ jobs:
562555
ctan/tongjithesis/
563556
retention-days: 90
564557

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-
}
615558

616559
- name: Download compiled PDFs from test workflow (only on manual dispatch)
617560
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)