Skip to content

Commit

Permalink
Create action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yusancky committed Apr 12, 2023
1 parent 576de17 commit eea0d12
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# setup-typst
Setup Typst in GitHub Actions
# Setup Typst

Setup Typst in GitHub Actions (currently only supported for Windows).

## Inputs

### `token`

The token used to authenticate when fetching Typst distributions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.

### `version`

Exact version of Typst to use.

## Example usage

```yaml
- uses: yusancky/[email protected]
id: setup-typst
with:
version: 'v0.2.0'
- run: typst compile file.typ
```
You can also use the additional uses given in [Usage](https://github.com/typst/typst#usage) in the Typst documentation.
34 changes: 34 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Setup Typst
author: yusancky
description: Setup Typst in GitHub Actions
inputs:
token:
description: The token used to authenticate when fetching Typst distributions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
version:
description: Exact version of Typst to use.
outputs:
path:
description: The absolute path to the Typst executable.
runs:
using: composite
steps:
- name: Download release
uses: robinraju/[email protected]
with:
repository: "typst/typst"
tag: ${{ inputs.version }}
fileName: "typst-x86_64-pc-windows-msvc.zip"
token: ${{ inputs.token }}
- name: Unzip Typst
run: 7z x typst-x86_64-pc-windows-msvc.zip -oc:\typst typst.exe -r
shell: bash
- name: Delete zip
run: rm -f typst-x86_64-pc-windows-msvc.zip
shell: bash
- name: Output Typst path
run: echo "c:\typst\typst-x86_64-pc-windows-msvc" >> $GITHUB_PATH
shell: bash
branding:
color: blue
icon: download

0 comments on commit eea0d12

Please sign in to comment.