-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Checkout Particular | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: canleskis/particular | ||
path: particular | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: wasm32-unknown-unknown | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Setup wasm-bindgen | ||
uses: jetli/[email protected] | ||
with: | ||
version: "0.2.89" | ||
|
||
- name: Deploy Benchmarks | ||
run: | | ||
bash scripts/deploy_benchmarks.sh content/benchmarks | ||
- name: Deploy Examples | ||
run: | | ||
bash scripts/deploy_showcase.sh | ||
- name: Deploy Site | ||
uses: shalzz/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,14 @@ | ||
# Add all the benchmarks to a list in single json file. | ||
|
||
out_dir=$1 | ||
name=${2:-"benchmarks"} | ||
particular_dir=${3:-"particular"} | ||
|
||
buffer="" | ||
|
||
for file in $particular_dir/particular/benches/results/*.json; do | ||
buffer+=$(cat "$file") | ||
buffer+="," | ||
done | ||
|
||
echo "[${buffer%?}]" > $out_dir/$name.json |
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,20 @@ | ||
path=$1 | ||
out_dir=$2 | ||
particular_dir=$3 | ||
|
||
metadata=$(grep -A3 "\[package.metadata.particular.rs\]" $path/Cargo.toml | grep -vE "^(#|\[)") | ||
|
||
if [ -n "$metadata" ]; then | ||
name=$(basename $path) | ||
|
||
RUSTFLAGS='-C target-feature=+simd128' cargo build -p $name --release --target wasm32-unknown-unknown --manifest-path $particular_dir/Cargo.toml | ||
wasm-bindgen --no-typescript --out-name example --out-dir $out_dir/$name --target web $particular_dir/target/wasm32-unknown-unknown/release/$name.wasm | ||
|
||
cp $path/preview.png $out_dir/$name/preview.png | ||
cp -r $path/assets $out_dir/$name/assets 2>/dev/null | ||
|
||
echo '+++ | ||
'"$metadata"' | ||
template = "demo.html" | ||
+++' >$out_dir/$name/index.md | ||
fi |
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,7 @@ | ||
particular_dir=${1:-"particular"} | ||
|
||
for subfolder in particular/examples/*; do | ||
if [ -d $subfolder ]; then | ||
bash scripts/deploy_example.sh $subfolder content/demos $particular_dir | ||
fi | ||
done |
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 +1 @@ | ||
particular.rs | ||
canleskis.github.io/particular-website/ |