Skip to content

Commit

Permalink
ci: make build-online (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
LogCreative authored Nov 27, 2022
1 parent 58332ac commit 830ab9a
Show file tree
Hide file tree
Showing 42 changed files with 384 additions and 121 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/1-usage.md

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/3-others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: 其他问题
about: 上面的模版无法归类的问题。使用问题请在 Discussions 区提问。
---
4 changes: 0 additions & 4 deletions .github/ISSUE_TEMPLATE/4-others.md

This file was deleted.

39 changes: 39 additions & 0 deletions .github/ci/build_online.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Online package will be in build/online.
ONLINE_DIR=build/online
ONLINE_FILENAME=sjtubeamer-online.zip

# Generate the latest files first.
cd src && l3build check && cd ..

# A clean directory start.
rm -rf ${ONLINE_DIR}
mkdir -p ${ONLINE_DIR}

# contrib
cp -rv contrib ${ONLINE_DIR}/

# build
mkdir -p ${ONLINE_DIR}/build
echo > ${ONLINE_DIR}/build/.gitkeep

# minimal workset
cp -rv vi ${ONLINE_DIR}/
cp -v beamer*.sty ${ONLINE_DIR}/
cp -v sjtu*.sty ${ONLINE_DIR}/

# quick start
cp -v src/doc/sjtubeamerquickstart.tex ${ONLINE_DIR}/
cp -v src/doc/ref.bib ${ONLINE_DIR}/

# Generate zip
cd ${ONLINE_DIR}
zip -r ${ONLINE_FILENAME} *
cd -
mv -f ${ONLINE_DIR}/${ONLINE_FILENAME} ${ONLINE_FILENAME}

echo -----------------------------------------------------
echo Online package is generated at ${ONLINE_DIR}.
echo Zipped file is at ./${ONLINE_FILENAME}.
echo -----------------------------------------------------
11 changes: 9 additions & 2 deletions .github/ci/build_package.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#!/bin/bash

# Build online package first.
.github/ci/build_online.sh

cd src

# This will trigger checkinit_hook() to move the files to the root directory.
l3build ctan
l3build cache-demo # cache demos for making the next ctan process faster
l3build manifest
l3build ctan
l3build clean-demo # for a clean restart

cd ..
.github/ci/copy_resources.sh

# Copy to the tds dir for uploading artifacts conveniently.
cp -v sjtubeamer-online.zip src/build/distrib/tds/

if [ ! -f src/sjtubeamer-ctan.zip ]; then
echo "BUILD FAILED."
echo "BUILD CTAN FAILED."
exit 1
fi
fi
2 changes: 1 addition & 1 deletion .github/ci/gen_cover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ done
echo \\end{document}>>build/cover.tex

# merge covers
latexmk $@ -outdir=build build/cover.tex
latexmk $@ -outdir=build build/cover.tex -f
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: build test variants with XeLaTeX
- uses: xu-cheng/texlive-action/full@v1
with:
run: .github/ci/gen_cover.sh -halt-on-error -time -quiet -xelatex
run: .github/ci/gen_cover.sh -halt-on-error -time -xelatex
name: build cover with XeLaTeX
- run: cat build/build-*.log
name: display build log
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
apk add zip diffutils
tlmgr update --self
tlmgr update l3build
.github/ci/build_package.sh
make build-dev
name: build package with l3build
- name: check if generated files are of latest version
run: |
Expand All @@ -86,6 +86,7 @@ jobs:
src/build/distrib/tds/doc
src/build/distrib/tds/source
src/build/distrib/tds/tex
src/build/distrib/tds/sjtubeamer-online.zip
name: sjtubeamer.tds
name: upload build artifacts
check-format:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
apk add zip diffutils
tlmgr update --self
tlmgr update l3build
.github/ci/build_package.sh
make build-dev
name: build package with XeLaTeX
- uses: xu-cheng/texlive-action/full@v1
with:
Expand Down Expand Up @@ -96,6 +96,15 @@ jobs:
asset_path: src/sjtubeamer-ctan.zip
asset_name: sjtubeamer-ctan.zip
asset_content_type: application/zip
- name: add online zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: sjtubeamer-online.zip
asset_name: sjtubeamer-online.zip
asset_content_type: application/zip
- name: add devguide
uses: actions/[email protected]
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ build-*.tex

*-ctan.zip
*.tds.zip
*-online.zip
*.listing
red.pdf
blue.pdf
Expand Down
2 changes: 1 addition & 1 deletion .vscode/sjtubeamer.code-snippets

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ build-cover: prepare
cp build/cover.pdf .

# Build sjtubeamer package
# This will build online package automatically.
build-dev: prepare
cd src && l3build ctan
.github/ci/build_package.sh

# Build online distribution
build-online: prepare
.github/ci/build_online.sh

# Build `main.tex` with multiple test variants
build-test-variants: prepare
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SJTUBeamer 是上海交通大学的非官方 Beamer 模版。您可以使用 SJT

## 快速上手 👋

目前的 `main.tex` 是一个示例文档《如何使用 LaTeX 排版论文》。您可以将里面的内容替换掉。下面是一个最简示例:
目前的 `main.tex` 是一个示例文档《如何使用 $\rm\LaTeX$ 排版论文》。您可以将里面的内容替换掉。下面是一个最简示例:

<details>

Expand Down Expand Up @@ -38,7 +38,7 @@ SJTUBeamer 是上海交通大学的非官方 Beamer 模版。您可以使用 SJT
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
\addbibresource{thesis.bib}
\institute[Linux User Group]{Linux 用户组} % 组织
\institute[SJTUG]{上海交通大学 Linux 用户组} % 组织
\title{SJTUBeamer 幻灯片模板} % 标题
\subtitle{SJTUBeamer Template} % 副标题
Expand Down Expand Up @@ -141,7 +141,7 @@ int main(){

目前模版最新的稳定版是 v3.0.0。您可以在 [发布页](https://github.com/sjtug/SJTUBeamer/releases) 查看修改日志和更多资料。通常来说,SJTUBeamer 的一个稳定版本包括如下内容:

* `sjtubeamerquickguide.pdf`:SJTUBeamer 快速入门。
* `sjtubeamerquickguide.pdf`:SJTUBeamer 快速入门,另见对应 [源代码](https://github.com/sjtug/SJTUBeamer/blob/main/src/doc/sjtubeamerquickstart.tex)
* `sjtubeamer.pdf`: **强烈推荐在使用前阅读一遍 👍👍👍** SJTUBeamer 用户文档。
* `sjtubeamerdevguide.pdf`: SJTUBeamer 开发指南。
* `sjtulib-talk-max-red.pdf`: 示例文档《如何使用 LaTeX 排版论文》的 `max,red` 主题版本。
Expand All @@ -157,7 +157,8 @@ int main(){
## 使用反馈与贡献代码 👷

* 文件清单详见 [MANIFEST](src/MANIFEST.md)
* 您可以通过 GitHub Issue 反馈使用时碰到的问题。同时,也欢迎您提交 PR 帮助我们改进。
* 在使用过程中,您可以在 [GitHub Discussions](https://github.com/sjtug/SJTUBeamer/discussions) 讨论区讨论任何使用上的问题、交流想法。
* 在开发过程中,您可以通过 [GitHub Issues](https://github.com/sjtug/SJTUBeamer/issues) 提供 SJTUBeamer 的 Bug 反馈和新功能提案。同时,也欢迎您直接提交 [Pull Request](https://github.com/sjtug/SJTUBeamer/pulls) 代码修改帮助我们改进。
* 所有对模版的修改应该在 `.dtx` 文件中进行,而后用 l3build 生成 sty 文件。
* 您可以阅读发布页面中的《SJTUBeamer 开发指南》`sjtubeamerdevguide.pdf` 了解模版的实现细节与编译方法。

Expand All @@ -174,10 +175,15 @@ int main(){

## 展示 🧐

![cover_1](https://user-images.githubusercontent.com/61653082/160813366-5c7bd98b-dc3c-43ac-9cf4-1cb375228470.jpg)
![cover_2](https://user-images.githubusercontent.com/61653082/160813386-8cb98131-0cae-456b-af1e-cec671e5fc8e.jpg)
![cover_3](https://user-images.githubusercontent.com/61653082/160813414-9b43c4b3-4e6d-4f51-9c63-ff7a87eafcf7.jpg)
![cover_4](https://user-images.githubusercontent.com/61653082/160813430-1c7647d4-6346-4fd8-b43f-e156b6234b0e.jpg)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/61653082/160813366-5c7bd98b-dc3c-43ac-9cf4-1cb375228470.jpg">
<img alt="Red Cover" src="https://user-images.githubusercontent.com/61653082/160813386-8cb98131-0cae-456b-af1e-cec671e5fc8e.jpg">
</picture>

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/61653082/160813414-9b43c4b3-4e6d-4f51-9c63-ff7a87eafcf7.jpg">
<img alt="Blue Cover" src="https://user-images.githubusercontent.com/61653082/160813430-1c7647d4-6346-4fd8-b43f-e156b6234b0e.jpg">
</picture>

## 许可证

Expand Down
22 changes: 14 additions & 8 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the beamer template exclusively for Shanghai Jiaotong University student

## Starting Up 👋

Current document `main.tex` is an example documentation of *How to Use LaTeX to Typeset Thesis*. You could replace the content with the following minimum working example:
Current document `main.tex` is an example documentation of *How to Use* $\LaTeX$ *to Typeset Thesis*. You could replace the content with the following minimum working example:

<details>

Expand Down Expand Up @@ -36,7 +36,7 @@ Current document `main.tex` is an example documentation of *How to Use LaTeX to
\usepackage{biblatex}
\addbibresource{thesis.bib}
\institute{Linux User Group}
\institute{SJTUG}
\title{SJTUBeamer}
\subtitle{A Beamer Template}
Expand Down Expand Up @@ -136,7 +136,7 @@ Edit `main.tex` and start to use.

The current stable version is v3.0.0。You could visit [the release page](https://github.com/sjtug/SJTUBeamer/releases) for the changelog and more details. Generally speaking, a release of SJTUBeamer has the following content:

* `sjtubeamerquickstart.pdf`:SJTUBeamer Quick Start.
* `sjtubeamerquickstart.pdf`:SJTUBeamer Quick Start. You could also read the [source code](https://github.com/sjtug/SJTUBeamer/blob/main/src/doc/sjtubeamerquickstart.tex) of the document.
* `sjtubeamer.pdf`: SJTUBeamer User Guide.
* `sjtubeamerdevguide.pdf`: SJTUBeamer Development Guide.
* `sjtulib-talk-max-red.pdf`: `max,red` version of `main.tex`.
Expand All @@ -152,7 +152,8 @@ Please use Chrome browser or Adobe Acrobat to open user guide, otherwise there c
## Feedback & Contribution 👷

* You could get the repository manifest in [MANIFEST](src/MANIFEST.md).
* Feel free to file an issue with GitHub Issues. At the same time, PRs are always welcomed.
* For regular users, feel free to ask questions and share ideas in [GitHub Discussions](https://github.com/sjtug/SJTUBeamer/discussions).
* For developers, Feel free to file an issue with [GitHub Issues](https://github.com/sjtug/SJTUBeamer/issues) to submit a bug report or a feature request. At the same time, [PRs](https://github.com/sjtug/SJTUBeamer/pulls) are always welcomed for direct code changes.
* The source code should be modified in `.dtx` files. Then use l3build to generate sty files.
* You could get more implementation details in `sjtubeamerdevguide.pdf`.

Expand All @@ -169,10 +170,15 @@ New contributors could add your name to the developer list in `sjtubeamerdevguid

## Appearance 🧐

![cover_1](https://user-images.githubusercontent.com/61653082/160813366-5c7bd98b-dc3c-43ac-9cf4-1cb375228470.jpg)
![cover_2](https://user-images.githubusercontent.com/61653082/160813386-8cb98131-0cae-456b-af1e-cec671e5fc8e.jpg)
![cover_3](https://user-images.githubusercontent.com/61653082/160813414-9b43c4b3-4e6d-4f51-9c63-ff7a87eafcf7.jpg)
![cover_4](https://user-images.githubusercontent.com/61653082/160813430-1c7647d4-6346-4fd8-b43f-e156b6234b0e.jpg)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/61653082/160813366-5c7bd98b-dc3c-43ac-9cf4-1cb375228470.jpg">
<img alt="Red Cover" src="https://user-images.githubusercontent.com/61653082/160813386-8cb98131-0cae-456b-af1e-cec671e5fc8e.jpg">
</picture>

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/61653082/160813414-9b43c4b3-4e6d-4f51-9c63-ff7a87eafcf7.jpg">
<img alt="Blue Cover" src="https://user-images.githubusercontent.com/61653082/160813430-1c7647d4-6346-4fd8-b43f-e156b6234b0e.jpg">
</picture>

## License

Expand Down
2 changes: 1 addition & 1 deletion beamercolorthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion beamerfontthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion beamerinnerthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion beamerouterthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion beamerthemesjtubeamer.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions contents/thesis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ \subsection{\SJTUThesis 上海交通大学学位论文模板}
\\\bottomrule
\end{tabular}
\end{table}
\item \SJTUThesis{} 可以通过指定 \texttt{unimath} 选项以使用 \pkg{unicode-math}
进行数学输入(\ref{frame:unicode-math} 页),注意与传统方式的区别
\end{itemize}
\end{frame}

Expand Down
3 changes: 3 additions & 0 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
%%
%% You should have received a copy of the license along with this
%% work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
%%
%% For a quick start, check out src/doc/sjtubeamerquickstart.tex
%% Join discussions: https://github.com/sjtug/SJTUBeamer/discussions
%% -----------------------------------------------------------------------

\documentclass[xcolor=table,dvipsnames,svgnames,aspectratio=169]{ctexbeamer}
Expand Down
2 changes: 1 addition & 1 deletion sjtucover.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sjtuvi.sty

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 830ab9a

Please sign in to comment.