Skip to content

Commit

Permalink
making sure to copy all necessary files to dist based on known build …
Browse files Browse the repository at this point in the history
…target
  • Loading branch information
catdad committed Nov 3, 2023
1 parent ced8945 commit f506f1e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
./scripts/run-ci-wasm.sh
ls -la
- name: Dist prep
run: ./dist-prep.sh
run: ./dist-prep.sh ${{ matrix.target }}
- name: Artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
36 changes: 29 additions & 7 deletions dist-prep.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

build_target="$1"

echoerr() { echo "$@" 1>&2; }

function assertFile {
Expand All @@ -15,13 +17,33 @@ rm -rf dist/*

ls -la libheif

cp libheif/libheif.js dist/libheif.js
cp libheif/COPYING dist/LICENSE
cp libheif/libheif.wasm dist/libheif.wasm || echo wasm not found
function copyJs() {
cp libheif/libheif.js dist/libheif.js
cp libheif/COPYING dist/LICENSE

assertFile dist/libheif.js
assertFile dist/LICENSE

chown $(whoami) dist/libheif.js dist/LICENSE
}

function copyWasm() {
copyJs

cp libheif/libheif.wasm dist/libheif.wasm
assertFile dist/libheif.wasm
chown $(whoami) dist/libheif.wasm
}

assertFile dist/libheif.js
assertFile dist/LICENSE
if [ "$build_target" = "js" ]
then
copyJs
elif [ "$build_target" = "wasm" ]
then
copyWasm
else
echo "unknown build target: $build_target"
exit 1
fi

chown $(whoami) dist/libheif.js dist/LICENSE
chown $(whoami) dist/libheif.wasm || echo wasm not found
ls -la dist

0 comments on commit f506f1e

Please sign in to comment.