Skip to content

Commit

Permalink
Merge branch 'main' into drop-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 authored Jun 9, 2024
2 parents f29d7c7 + 2bfe946 commit c5f614b
Show file tree
Hide file tree
Showing 28 changed files with 1,130 additions and 1,028 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/release-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ labels: Release
---

- [ ] 提升版本号到最新
- [ ] 上传新的模板到 Overleaf
- [ ] 发布新的 Release
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
93 changes: 67 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: xu-cheng/texlive-action/full@v1
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: |
apk add make msttcorefonts-installer fontconfig
update-ms-fonts
fc-cache -f
make doc
make handbooks
- name: Upload bithesis.pdf for later usage.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bithesis
path: bithesis.pdf
- name: Upload handbooks for later usage.
uses: actions/upload-artifact@v4
with:
name: handbooks
path: "the-graduates-handbook/*.pdf"
- name: Upload *.cls for later usage.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cls
path: "*.cls"
Expand Down Expand Up @@ -64,13 +71,13 @@ jobs:
cls: bithesis

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download bithesis.pdf
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bithesis
- name: Download `*.cls`
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cls
- name: Copy manual to the template folder.
Expand Down Expand Up @@ -100,9 +107,9 @@ jobs:
cls: [bithesis, bitreport, bitbeamer]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download *.cls
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cls
- name: Upload ${{ matrix.cls }}.cls to release
Expand All @@ -113,8 +120,8 @@ jobs:
asset_name: ${{ matrix.cls }}.cls
tag: ${{ github.ref }}

update_changelog:
name: Generate changelog
release_notes:
name: Populate release notes with latest changelog and PDFs
runs-on: ubuntu-latest
# Makesure it's the last job.
needs: [build, publish_cls, publish_templates]
Expand All @@ -136,22 +143,47 @@ jobs:
OUTPUT: CHANGES.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v2
- name: Download PDF(s)
uses: actions/download-artifact@v3
- uses: actions/checkout@v4

- name: Download bithesis.pdf
uses: actions/download-artifact@v4
with:
name: bithesis

- name: Upload the releases notes
- name: Upload bithesis.pdf and changelog
uses: svenstaro/upload-release-action@v2
with:
file: bithesis.pdf
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
overwrite: true
body: |
> [!TIP]
> 若是初次使用,可先参考**快速使用指南**([本科][undergraduate-handbook]/[硕博][graduate-handbook])或者 [Wiki 网站](https://bithesis.bitnp.net/)。有需要再进一步参考[详细配置手册`bithesis.pdf`][bithesis-pdf]。
[undergraduate-handbook]: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/undergraduate-handbook.pdf
[graduate-handbook]: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/graduate-handbook.pdf
[bithesis-pdf]: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/bithesis.pdf
${{ steps.git-cliff.outputs.content }}
- name: Download handbooks
uses: actions/download-artifact@v4
with:
name: handbooks
path: the-graduates-handbook
- name: Upload undergraduate-handbook
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: the-graduates-handbook/undergraduate-handbook.pdf
tag: ${{ github.ref }}
- name: Upload graduate-handbook
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: the-graduates-handbook/graduate-handbook.pdf
tag: ${{ github.ref }}

upload_to_ctan:
name: Upload to CTAN
runs-on: ubuntu-latest
Expand All @@ -160,7 +192,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download bithesis.pdf
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bithesis
- run: make pkg-only
Expand Down Expand Up @@ -189,7 +221,7 @@ jobs:
to [CTAN](https://www.ctan.org/pkg/bithesis)." >> "$GITHUB_STEP_SUMMARY"
changelog:
name: Update changelog
name: Update CHANGELOG
runs-on: ubuntu-latest
if: ${{ ! github.event.release.prerelease }}
steps:
Expand All @@ -199,7 +231,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}

- name: Generate a changelog
- name: Update CHANGELOG
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
Expand All @@ -208,11 +240,20 @@ jobs:
OUTPUT: CHANGELOG.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit
- name: Create a PR
# Changes must be made through the merge queue, therefore a PR is necessary.
id: pr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update CHANGELOG for ${{ github.event.release.tag_name }}
title: Update CHANGELOG for ${{ github.event.release.tag_name }}

- name: Report status
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 ${{ github.event.repository.default_branch }}
echo "[Pull request #${{ steps.pr.outputs.pull-request-number }}](${{ steps.pr.outputs.pull-request-url }}) is created to update CHANGELOG." >> "$GITHUB_STEP_SUMMARY"
- name: Merge the PR
run: |
gh pr merge ${{ steps.pr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action/full@v1
- uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: |
apk add make msttcorefonts-installer fontconfig
update-ms-fonts
Expand Down
Loading

0 comments on commit c5f614b

Please sign in to comment.