diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..30af64cd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: ci + +on: + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Log in to registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + - name: Build + run: | + ./build-with-docker.sh + - uses: actions/upload-artifact@v3 + with: + name: dist + path: | + ./build/llvm/bin/llvm-box.wasm + ./build/llvm/bin/llvm-box.mjs + retention-days: 7 + + release: + needs: build + name: Create Release + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + - uses: softprops/action-gh-release@v1 + with: + files: dist/*.* + - name: Setup npmrc + run: | + echo "@jprendes:registry=https://npm.pkg.github.com/" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" >> .npmrc + - name: Publish + run: npm publish diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..9e85ce80 --- /dev/null +++ b/.npmignore @@ -0,0 +1,16 @@ +.github +box_src +build +demo +docker +emlib +packs +patches +quicknode +src +tooling +upstream +.gitignore +*.sh +node_modules +yarn.lock diff --git a/llvm-box.d.mts b/llvm-box.d.mts new file mode 100644 index 00000000..6c739723 --- /dev/null +++ b/llvm-box.d.mts @@ -0,0 +1,5 @@ +interface FsModule extends EmscriptenModule { + FS: typeof FS; +} + +export default Module as EmscriptenModuleFactory; diff --git a/package.json b/package.json new file mode 100644 index 00000000..5910e4f4 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "@jprendes/emception", + "version": "1.0.0", + "author": "jprendes", + "license": "MIT", + "main": "dist/llvm-box.mjs", + "type": "module", + "types": "llvm-box.d.mts", + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, + "dependencies": { + "@types/emscripten": "^1.39.8" + } +} \ No newline at end of file