Skip to content

Commit

Permalink
package
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwalko committed Dec 10, 2021
1 parent 6d56a7e commit 165b494
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 3,279 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish Package to npmjs
on:
release:
types: created

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'

- run: yarn

- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "include/survex"]
path = include/survex
url = https://github.com/ojwb/survex.git
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build.sh
include/
node_modules/
.git/
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Example
# survex.js

Dependencies
- survex: 1.4.1


### Example

```
const survex = require('survex.js');
Expand Down
22 changes: 16 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash

emcc img.c img_shim.c \
-O3 \
-s EXPORTED_FUNCTIONS="['_free']" \
-s EXPORTED_RUNTIME_METHODS="['FS', 'getValue', 'UTF8ToString']" \
-o img.js
# -s FORCE_FILESYSTEM=1 \
package() {
rm -rf package
mkdir -p package
pushd package &>/dev/null
cp ../include/img_shim.c ../include/survex/src/{img.c,img.h} .
emcc img.c img_shim.c \
-O3 \
-s EXPORTED_FUNCTIONS="['_free']" \
-s EXPORTED_RUNTIME_METHODS="['FS', 'getValue', 'UTF8ToString']" \
-o ../img.js
popd &>/dev/null
rm -rf package
}


$@
Loading

0 comments on commit 165b494

Please sign in to comment.