Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvignoli/typst-action
Typst GitHub action
https://github.com/lvignoli/typst-action
Last synced: 3 days ago
JSON representation
Typst GitHub action
- Host: GitHub
- URL: https://github.com/lvignoli/typst-action
- Owner: lvignoli
- License: mit
- Created: 2023-03-28T14:59:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-13T05:30:51.000Z (5 months ago)
- Last Synced: 2025-01-01T15:08:55.737Z (10 days ago)
- Language: Python
- Size: 30.3 KB
- Stars: 58
- Watchers: 1
- Forks: 13
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-typst - typst-action - Build Typst documents using GitHub actions (Integrations & Tools / CI/CD)
- awesome-typst-cn - typst-action
README
# Typst GitHub action
Build Typst documents using GitHub workflows.
## Minimal example
The following `.github/workflows/build.yaml` action compiles `main.typ` to `main.pdf` on every push.
```yaml
name: Build Typst document
on: pushjobs:
build_typst_documents:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst
uses: lvignoli/typst-action@main
with:
source_file: main.typ
```## Longer example
Here we compile multiple files on each push, and publish all the PDFs in a tagged and timestamped release when the commit is tagged.
```yaml
name: Build Typst document
on: [push, workflow_dispatch]permissions:
contents: writejobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst
uses: lvignoli/typst-action@main
with:
source_file: |
first_file.typ
second_file.typ
third_and_final_file.typ- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDF
path: *.pdf- name: Get current date
id: date
run: echo "DATE=$(date +%Y-%m-%d-%H:%M)" >> $GITHUB_ENV- name: Release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
name: "${{ github.ref_name }} — ${{ env.DATE }}"
files: main.pdf```
Repository [lvignoli/typst-action-example](https://github.com/lvignoli/typst-action-example) provides an example setup on a whole repo.
## Notes
- This action runs on the docker image shipped with the latest Typst.
As long as Typst is in v0, changes of the CLI API are to be expected, breaking the workflow.
I'll update regularly.- I was hasty to tag for a v1. I have now deleted it.
As long as Typst is not in a stable state, the action will stay in v0.
You should use `lvignoli/typst-action@main` in the meantime.