commit 5407426da6ac757d5f26ab279d6e20c5a728be86
Author: Minerva_juppiter <94231606+minerva-jupiter@users.noreply.github.com>
Date: Fri, 19 Sep 2025 18:03:26 +0900
Initial commit
Diffstat:
5 files changed, 134 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/PushBuild.yaml b/.github/workflows/PushBuild.yaml
@@ -0,0 +1,22 @@
+name: Typst Compile when push
+
+on:
+ push:
+ branch-ignore:
+ - nobuild*
+
+jobs:
+ PushBuild:
+ name: PushBuild
+ runs-on: self-hosted
+ steps:
+ - name: Set up Git repo
+ uses: actions/checkout@v2
+ - name: compile typst
+ run: typst compile --font-path ~/.fonts *.typ
+ - name: Upload PDF artifact
+ id: artifact-upload-step
+ uses: actions/upload-artifact@v4
+ with:
+ path: ./*.pdf
+ retention-days: 7
diff --git a/.github/workflows/ReleaseBuild.yaml b/.github/workflows/ReleaseBuild.yaml
@@ -0,0 +1,27 @@
+name: Typst Compile when version released
+
+on:
+ push:
+ tags:
+ - '*.*.*'
+
+jobs:
+ PushBuild:
+ name: PushBuild
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Git repo
+ uses: actions/checkout@v2
+ - name: Download fonts to ./fonts
+ run: mkdir fonts && cd fonts && curl -L -o NotoSansJP-Regular.otf https://github.com/googlefonts/noto-cjk/raw/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf && cd .. && tree .
+ - name: compile typst with docker
+ run: sudo docker run --rm --volume ./:/home/ ghcr.io/typst/typst:latest compile --font-path /home/fonts /home/test.typ
+ - name: Create Release & upload asset
+ id: create_release-upload_assets
+ uses: softprops/action-gh-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ files: ./*.pdf
+ draft: true
+ prerelease: false
diff --git a/LICENSE b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Minerva_juppiter
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
@@ -0,0 +1,43 @@
+# typst-githubrun-template
+
+This repository provides a template for a GitHub Action that automates the process of compiling **Typst** documents into PDFs. When you push changes to your repository, this workflow automatically generates a PDF from your `.typ` files and uploads it as a **GitHub Artifact**.
+
+## What is Typst?
+
+`Typst` is a new, web-first markup-based typesetting system. It's designed to be powerful and easy to use, providing a modern alternative to traditional tools like LaTeX. You can learn more about it on the [official Typst website](https://typst.app/).
+
+# Getting Started
+
+1. Click the `Use this template` button at the top of this repository to create a new repository based on this template.
+2. Set up self hosted runner. In The repository's setting tab, you can click actions and select runner setting. you will see a button of adding new self hosted runner.
+3. Put your `.typ` files in your repository.
+4. The workflow will run automatically on the first push and subsequent pushes. You can find the generated PDF in the **Actions** tab's Artifact of your repository.
+
+# LICENSE
+I provide this with MIT LICENSE.
+
+# Font Setting
+## Default
+These fonts are available
+- DejaVu Sans
+- DejaVu Sans Mono
+- DejaVu Serif
+- Libertinus Serif
+- New Computer Modern
+- New Computer Modern Math
+- Noto Sans CJK JP
+But,`Noto Sans CJK JP` is not typst default font.
+So if you could use the font on Self hosted runner, you have to install(put font file in `~/.fonts`) that.You can see link of that in ReleaseBuild.yaml
+If you want to use additional fonts, you can set up it.
+## On Self hosted runner
+Only you have to do is that download font and put it in ~/.fonts/
+## On Github Runner
+You have to add code of font download to workflows file.
+
+# Release
+This repo is set up for release build.
+It runs on GitHub hosted runner, and static(it does not depend on the situation of self-hosted server).
+
+## how to create release with ReleaseBuild
+Create Release tag named `*.*.*`.
+And create Release with that tag.
diff --git a/test.typ b/test.typ
@@ -0,0 +1,21 @@
+#set text(lang: "ja", font: "Noto Sans CJK JP")
+#set par(leading: 1.5em)
+#set page(numbering: "- 1 -",header: "物理学概論14回課題")
+
+
+一般に、誤解されているが、ビオ・サバールの法則は、ジャン・バティスタ・ビオとフェリックス・サバールの両者が共同で実験して発見した法則である。
+まず、ジャン・バティスタ・ビオについて解説する。
+彼はフランスのパリ出身で、様々な分野に貢献した人物であった。(遠い昔の学者は総じて貢献範囲が広いが)
+彼の研究では測量や、大気圧、岩石の雲母に関する研究など、非常に多岐にわたっている。\
+フェリックス・サバールもフランスの物理学者、医者である。
+人間の可聴域の下限を調べる装置や、弦の振動に関する研究を行ったほか、分子物理学にっも功績があるらしい(具体的な成果に関しては情報を得られなかった)\
+\
+まず、彼らの実験の以前に、エルステッドは電気回路によって方位磁針の向きが変わることから、電流が磁場をつくることを発明した。
+それを受けて、彼らの行った、ビオ・サバールの実験は、長い動線を垂直に垂らし、そこから水平に離れた位置に方位磁針を置くと、電流を流したときに方位磁針が振れるのを確認したものであった。
+また、方位磁針の振れ方の周期を測定することで、方位磁針にかかっている力のモーメントから、磁場の強さを求めることで、ビオ・サバール法則を導きだした。\
+彼らの導き出したビオ・サバールの法則は、電流が磁場を作り出す規則性について求めたものであり、高校物理学における基礎的な減少になっている(なお高校物理学では積分を使えないためこの法則を習うことはできない)\
+\
+[参考文献]\
+https://fnorio.com/0094Biot-Savart_law1/Biot-Savart_law1.html \
+https://en.wikipedia.org/wiki/Jean-Baptiste_Biot \
+https://en.wikipedia.org/wiki/F%C3%A9lix_Savart