diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..05f4fdc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Build box2d3-wasm + +on: + # release: + # types: [created] + workflow_dispatch: + +env: + EM_VERSION: 3.1.73 + EM_CACHE_FOLDER: 'emsdk-cache' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup cache + id: cache-system-libraries + uses: actions/cache@v4 + with: + path: ${{env.EM_CACHE_FOLDER}} + key: ${{env.EM_VERSION}}-${{ runner.os }} + - uses: mymindstorm/setup-emsdk@v14 + with: + version: ${{env.EM_VERSION}} + actions-cache-folder: ${{env.EM_CACHE_FOLDER}} + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: install global deps + run: npm i -g typescript yarn + - name: build makefile + working-directory: box2d3-wasm + run: shell/0_build_makefile.sh + env: + FLAVOUR: simd + TARGET_TYPE: Debug + - name: emmake + working-directory: box2d3-wasm + run: emmake make -j8 -C cmake-build + - name: build wasm + working-directory: box2d3-wasm + run: shell/1_build_wasm.sh + env: + FLAVOUR: simd + TARGET_TYPE: Debug + + # publish-gpr: + # needs: build + # runs-on: ubuntu-latest + # permissions: + # contents: read + # packages: write + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-node@v4 + # with: + # node-version: 20 + # registry-url: https://npm.pkg.github.com/ + # - run: npm ci + # - run: npm publish + # env: + # NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}