Vendor Typst compiler locally instead of depending on typstdrive folder
This commit is contained in:
@@ -23,8 +23,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Clone Typst compiler
|
- name: Clone Typst compiler
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/typst/typst.git typstdrive/typst
|
git clone https://github.com/typst/typst.git typst-desktop/typst
|
||||||
git -C typstdrive/typst checkout "$TYPST_COMMIT"
|
git -C typst-desktop/typst checkout "$TYPST_COMMIT"
|
||||||
|
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -85,17 +85,18 @@ jobs:
|
|||||||
path: packages/*
|
path: packages/*
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Publish to GitHub release
|
- name: Publish to Gitea release
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GITEA_URL: https://git.sirblob.co
|
||||||
REPOSITORY: sirblobby/typst-desktop
|
REPOSITORY: sirblobby/typst-desktop
|
||||||
TAG: ${{ github.ref_name }}
|
TAG: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
api="https://api.github.com/repos/$REPOSITORY"
|
api="$GITEA_URL/api/v1/repos/$REPOSITORY"
|
||||||
auth="Authorization: Bearer $TOKEN"
|
auth="Authorization: token $TOKEN"
|
||||||
json="Content-Type: application/json"
|
json="Content-Type: application/json"
|
||||||
|
|
||||||
existing=$(curl -sS -H "$auth" "$api/releases/tags/$TAG" | jq -r '.id // empty')
|
existing=$(curl -sS -H "$auth" "$api/releases/tags/$TAG" | jq -r '.id // empty')
|
||||||
@@ -118,9 +119,8 @@ jobs:
|
|||||||
name=$(basename "$package")
|
name=$(basename "$package")
|
||||||
echo "Uploading $name"
|
echo "Uploading $name"
|
||||||
curl -sS --fail -X POST -H "$auth" \
|
curl -sS --fail -X POST -H "$auth" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-F "attachment=@$package" \
|
||||||
--data-binary "@$package" \
|
"$api/releases/$release_id/assets?name=$name" \
|
||||||
"https://uploads.github.com/repos/$REPOSITORY/releases/$release_id/assets?name=$name" \
|
|
||||||
> /dev/null
|
> /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Clone Typst compiler
|
- name: Clone Typst compiler
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/typst/typst.git typstdrive/typst
|
git clone https://github.com/typst/typst.git typst-desktop/typst
|
||||||
git -C typstdrive/typst checkout "$TYPST_COMMIT"
|
git -C typst-desktop/typst checkout "$TYPST_COMMIT"
|
||||||
|
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
|
/typst
|
||||||
/build
|
/build
|
||||||
/.svelte-kit
|
/.svelte-kit
|
||||||
/package
|
/package
|
||||||
|
|||||||
@@ -169,10 +169,10 @@ The editor header shows the language server status. Without `tinymist` the edito
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
The app compiles Typst from source, so clone the compiler into TypstDrive's `typst/` folder first — both projects share it:
|
The app compiles Typst from source, so clone the compiler into this repo's `typst/` folder first:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/typst/typst.git ../typstdrive/typst
|
git clone https://github.com/typst/typst.git typst
|
||||||
```
|
```
|
||||||
|
|
||||||
Then:
|
Then:
|
||||||
@@ -200,11 +200,11 @@ macOS builds are unsigned. Gatekeeper blocks unsigned apps on first launch, so o
|
|||||||
|
|
||||||
### Building locally for another platform
|
### Building locally for another platform
|
||||||
|
|
||||||
Building on the target platform is the supported path. The Typst compiler is a path dependency, so any machine or runner needs it checked out beside this repository:
|
Building on the target platform is the supported path. The Typst compiler is a path dependency, so any machine or runner needs it checked out inside this repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/typst/typst.git ../typstdrive/typst
|
git clone https://github.com/typst/typst.git typst
|
||||||
git -C ../typstdrive/typst checkout 44b3f78ed37fedea75e911dde2269ef86c45316f
|
git -C typst checkout 9dfd3a08500b7896045f907433cf7b4b02434fad
|
||||||
```
|
```
|
||||||
|
|
||||||
Linux builds also need the WebKit and GTK development packages:
|
Linux builds also need the WebKit and GTK development packages:
|
||||||
@@ -217,6 +217,8 @@ sudo apt-get install libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev patchelf
|
|||||||
bun run build:linux
|
bun run build:linux
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Build on Ubuntu 22.04 (the CI baseline) rather than a rolling-release distro. glibc compatibility only works forward, so a binary is only guaranteed to run on distros with a glibc version equal to or newer than the one it was built against. This won't cover musl-based distros like Alpine, or glibc-based distros older than the build machine.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Apache License 2.0. See [LICENSE](LICENSE).
|
Apache License 2.0. See [LICENSE](LICENSE).
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ serde = { version = "1", features = ["derive"] }
|
|||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
rusqlite = { version = "0.32", features = ["bundled"] }
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
||||||
|
|
||||||
typst = { version = "0.15.1", path = "../../typstdrive/typst/crates/typst" }
|
typst = { version = "0.15.1", path = "../typst/crates/typst" }
|
||||||
typst-kit = { path = "../../typstdrive/typst/crates/typst-kit", features = ["system-downloader", "system-packages", "embedded-fonts"] }
|
typst-kit = { path = "../typst/crates/typst-kit", features = ["system-downloader", "system-packages", "embedded-fonts"] }
|
||||||
typst-pdf = { path = "../../typstdrive/typst/crates/typst-pdf" }
|
typst-pdf = { path = "../typst/crates/typst-pdf" }
|
||||||
typst-render = { path = "../../typstdrive/typst/crates/typst-render" }
|
typst-render = { path = "../typst/crates/typst-render" }
|
||||||
typst-svg = { path = "../../typstdrive/typst/crates/typst-svg" }
|
typst-svg = { path = "../typst/crates/typst-svg" }
|
||||||
typst-html = { path = "../../typstdrive/typst/crates/typst-html" }
|
typst-html = { path = "../typst/crates/typst-html" }
|
||||||
typst-layout = { path = "../../typstdrive/typst/crates/typst-layout" }
|
typst-layout = { path = "../typst/crates/typst-layout" }
|
||||||
typst-assets = { version = "0.15.1", features = ["fonts"] }
|
typst-assets = { version = "0.15.1", features = ["fonts"] }
|
||||||
|
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
|
|||||||
Reference in New Issue
Block a user