Skip to content

Commit

Permalink
Merge pull request #426 from YDX-2147483647/main
Browse files Browse the repository at this point in the history
CI: Upload to CTAN and minor fixes
  • Loading branch information
fky2015 authored Mar 25, 2024
2 parents dd3768a + 28b2808 commit 9ba188e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/release-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ labels: Release

- [ ] 提升版本号到最新
- [ ] 通过单元测试
- [ ] `bithesis` 是否需要更新
- [ ] 上传 CTAN
- [ ] 上传新的模板到 Overleaf
- [ ] 模板是否需要更新
- [ ] 发布新的 Release
61 changes: 35 additions & 26 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 @@ -113,7 +113,7 @@ jobs:
asset_name: ${{ matrix.cls }}.cls
tag: ${{ github.ref }}

publish_pdfs:
update_changelog:
name: Generate changelog
runs-on: ubuntu-latest
# Makesure it's the last job.
Expand Down Expand Up @@ -152,29 +152,38 @@ jobs:
body: |
${{ steps.git-cliff.outputs.content }}
update_changelog:
name: Generate changelog
upload_to_ctan:
name: Upload to CTAN
runs-on: ubuntu-latest
needs: build
if: ${{ ! github.event.release.prerelease }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
- uses: actions/checkout@v4
- name: Download bithesis.pdf
uses: actions/download-artifact@v3
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit
name: bithesis
- run: make pkg-only
- name: Determine version
id: version
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "Update CHANGELOG"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/BITNP/BIThesis.git main
version=${{ github.event.release.tag_name }}
echo "number=$(echo $version | sed 's/^v//')" >> "$GITHUB_OUTPUT"
echo "date=$(date '+%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Upload to CTAN
uses: paolobrasolin/ctan-submit-action@v1
with:
action: upload
file_path: bithesis.zip
fields: |
update: "true"
pkg: bithesis
version: ${{ steps.version.outputs.number }} ${{ steps.version.outputs.date }}
author: Feng Kaiyu
email: [email protected]
uploader: Feng Kaiyu
- name: Report
run: >
echo "🎉 Successfully upload
${{ 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`。(同样被用于 GitHub Actions)
- `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 9ba188e

Please sign in to comment.