Skip to content

Commit

Permalink
ci: upload to CTAN
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 committed Mar 25, 2024
1 parent dd3768a commit 278cb7a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
45 changes: 42 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release

on:
push:
tags:
- "*.*.*"
release:
types:
- published

jobs:
build:
Expand Down Expand Up @@ -178,3 +178,42 @@ jobs:
git add CHANGELOG.md
git commit -m "Update CHANGELOG"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/BITNP/BIThesis.git main
upload_to_ctan:
name: Upload to CTAN
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download bithesis.pdf
uses: actions/download-artifact@v3
with:
name: bithesis
- run: make pkg-only
- name: Determine version
id: version
run: |
version=${{ github.event.release.tag_name }}
echo "number=$(echo $version | sed 's/^v//')" >> "$GITHUB_OUTPUT"
echo "date=$(date '+%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Determine action
id: action
run: |
echo "action=${{ github.event.release.prerelease && 'validate' || 'upload' }}" >> "$GITHUB_OUTPUT"
- name: Upload to CTAN
uses: paolobrasolin/ctan-submit-action@v1
with:
action: ${{ steps.action.outputs.action }}
file_path: bithesis.zip
fields: |
update: "true"
pkg: bithesis
version: ${{ steps.version.outputs.number }} ${{ steps.version.outputs.date }}
author: Feng Kaiyu
email: loveress01@outlook.com
uploader: Feng Kaiyu
- name: Report
run: >
echo "🎉 Successfully ${{ steps.action.outputs.action }}
${{ steps.version.outputs.number }} (${{ steps.version.outputs.date }})
to [CTAN](https://www.ctan.org/pkg/bithesis)." >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ make doc
## 打包

- `make overleaf version=X.X.X` 可以生成上传 overleaf 所需要的 zip 文件。
- `make pkg` 可以生成上传 CTAN 所需要的 zip 文件。
- `make pkg` 可以生成上传 CTAN 所需要的 zip 文件。若已有手册而不想重新编译,可 `make pkg-only`
- `make grad version=X.X.X` 可以生成用作研究生院官网附件的 zip 文件。

## 上传 Overleaf 与更新
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
endif


.PHONY: all cls doc clean FORCE_MAKE copy
.PHONY: all cls doc clean FORCE_MAKE copy pkg pkg-only

$(PACKAGE).pdf: cls FORCE_MAKE
@$(LATEXMK) -xelatex $(PACKAGE).dtx
Expand Down Expand Up @@ -94,13 +94,15 @@ dev:
dev-doc:
ls bithesis.dtx | entr -s 'make clean-all && yes y | make doc && open bithesis.pdf'

pkg: doc
pkg-only:
rm -rf ./bithesis ./bithesis.zip
mkdir bithesis
cp bithesis.{ins,dtx,pdf} ./README*.md ./contributing*.md ./bithesis
cp bithesis.ins bithesis.dtx bithesis.pdf ./README*.md ./contributing*.md ./bithesis
mv ./bithesis/README-bithesis.md ./bithesis/README.md
zip -r bithesis.zip bithesis

pkg: doc pkg-only

GRAD_DEST_DIR = ./BIThesis-graduate-thesis-template

grad: doc copy FORCE_MAKE
Expand Down

0 comments on commit 278cb7a

Please sign in to comment.