-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add xtask to project * Add CI automation * Cleanup repository * Enable crate builds for non-wasm targets Signed-off-by: Tin Švagelj <[email protected]>
- Loading branch information
Showing
30 changed files
with
2,680 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[build] | ||
target = "wasm32-wasip1" | ||
[alias] | ||
xtask = "run --package xtask --release --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
XTASK_WASI_SDK_VERSION: 24 | ||
XTASK_BINARYEN_VERSION: 119 | ||
XTASK_TYPST_VERSION: 0.12.0 | ||
XTASK_WORK_DIR: ./ci_work_dir | ||
|
||
jobs: | ||
test: | ||
name: Build Typst Plugin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: wasm32-wasip1 | ||
- name: Restore WASI SDK | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ci_work_dir/wasi_sdk | ||
key: tools-wasi-sdk-${{ env.XTASK_WASI_SDK_VERSION }} | ||
- name: Restore wasi-stub | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
zint-typst-plugin/vendor/wasm-minimal-protocol/target/release/wasi-stub | ||
zint-typst-plugin/vendor/wasm-minimal-protocol/target/debug/wasi-stub | ||
key: tools-wasi-stub-${{ hashFiles('zint-typst-plugin/vendor/wasm-minimal-protocol/crates/wasi-stub/**') }} | ||
- name: Restore wasm-opt | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ci_work_dir/tools/wasm-opt | ||
key: tools-binaryen-${{ env.XTASK_BINARYEN_VERSION }} | ||
- name: Restore typst | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ci_work_dir/tools/typst | ||
key: tools-typst-${{ env.XTASK_TYPST_VERSION }} | ||
- name: Run CI xtask | ||
run: cargo xtask ci | ||
- name: Cache WASI SDK | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ci_work_dir/wasi_sdk | ||
key: tools-wasi-sdk-${{ env.XTASK_WASI_SDK_VERSION }} | ||
- name: Cache wasi-stub | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
zint-typst-plugin/vendor/wasm-minimal-protocol/target/release/wasi-stub | ||
zint-typst-plugin/vendor/wasm-minimal-protocol/target/debug/wasi-stub | ||
key: tools-wasi-stub-${{ hashFiles('zint-typst-plugin/vendor/wasm-minimal-protocol/crates/wasi-stub/**') }} | ||
- name: Cache wasm-opt | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ci_work_dir/tools/wasm-opt | ||
key: tools-binaryen-${{ env.XTASK_BINARYEN_VERSION }} | ||
- name: Cache typst | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ci_work_dir/tools/typst | ||
key: tools-typst-${{ env.XTASK_TYPST_VERSION }} | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: plugin-wasm | ||
path: ./typst-package/zint_typst_plugin.wasm | ||
retention-days: 7 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: manual | ||
path: ./typst-package/manual.pdf | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[submodule "zint-wasm-sys/zint"] | ||
path = zint-wasm-sys/zint | ||
url = https://github.com/zint/zint | ||
[submodule "zint-typst-plugin/vendor/wasm-minimal-protocol"] | ||
path = zint-typst-plugin/vendor/wasm-minimal-protocol | ||
url = https://github.com/Caellian/wasm-minimal-protocol.git | ||
branch = zint-wasi-vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
[workspace] | ||
package.edition = "2021" | ||
package.license = "MIT" | ||
resolver = "2" | ||
members = [ | ||
"zint-wasm-sys", | ||
"zint-wasm-rs", | ||
"zint-typst-plugin" | ||
"zint-typst-plugin", | ||
"zint-typst-plugin/vendor/wasm-minimal-protocol/crates/macro", | ||
"zint-typst-plugin/vendor/wasm-minimal-protocol/crates/wasi-stub", | ||
"xtask" | ||
] | ||
package.license = "MIT" | ||
default-members = [ | ||
"zint-wasm-sys", | ||
"zint-wasm-rs", | ||
"zint-typst-plugin", | ||
] | ||
|
||
[profile.release] | ||
lto = true # Enable link-time optimization | ||
strip = true # Strip symbols from binary* | ||
opt-level = 'z' # Optimize for size | ||
codegen-units = 1 # Reduce number of codegen units to increase optimizations | ||
panic = 'abort' # Abort on panic | ||
# Enable link-time optimization | ||
lto = true | ||
# Strip symbols from binary | ||
strip = true | ||
|
||
[profile.plugin-debug] | ||
inherits = "dev" | ||
# Abort on panic | ||
panic = 'abort' | ||
|
||
[profile.plugin-release] | ||
inherits = "release" | ||
# Optimize for size | ||
opt-level = 'z' | ||
# Reduce number of codegen units to increase optimizations | ||
codegen-units = 1 | ||
# Abort on panic | ||
panic = 'abort' | ||
|
||
[workspace.dependencies] | ||
walkdir = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.