fix tsconfig for ts6 #126
This file contains hidden or 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
| name: "Build" | |
| on: | |
| push: | |
| env: | |
| EM_VERSION: 4.0.9 | |
| EM_CACHE_FOLDER: "emsdk-cache" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: "true" | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8.1.0 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get subrepo revisions | |
| shell: bash | |
| run: | | |
| echo "OCGCORE_REV=$(git -C cpp/ygo rev-parse HEAD)" >> $GITHUB_ENV | |
| echo "LUA_REV=$(git -C cpp/lua rev-parse HEAD)" >> $GITHUB_ENV | |
| - name: Cache wasm build | |
| id: cache-wasm | |
| uses: actions/cache@v3 | |
| with: | |
| path: lib | |
| key: ocgcore-build-${{env.EM_VERSION}}-${{ hashFiles('scripts/build.sh') }}-${{ hashFiles('cpp/wasm.cpp') }}-${{ env.OCGCORE_REV }}-${{ env.LUA_REV }} | |
| - name: Cache emsdk | |
| if: ${{ steps.cache-wasm.outputs.cache-hit != 'true' }} | |
| id: cache-emsdk | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{env.EM_CACHE_FOLDER}} | |
| key: ${{env.EM_VERSION}}-${{ runner.os }} | |
| - name: Setup emsdk | |
| if: ${{ steps.cache-wasm.outputs.cache-hit != 'true' }} | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{env.EM_VERSION}} | |
| actions-cache-folder: ${{env.EM_CACHE_FOLDER}} | |
| - name: Build wasm | |
| if: ${{ steps.cache-wasm.outputs.cache-hit != 'true' }} | |
| run: | | |
| chmod a+x ./scripts/build.sh | |
| ./scripts/build.sh | |
| - name: Build Library | |
| run: pnpm run build:lib | |
| - name: Build Types | |
| run: pnpm run build:types | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: | | |
| README.md | |
| src | |
| lib | |
| dist | |
| package.json | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/release' | |
| steps: | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| - name: Publish on npm | |
| id: publish | |
| uses: JS-DevTools/npm-publish@v2 | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| release-jsr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: build | |
| if: github.ref == 'refs/heads/release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| - name: Publish on jsr | |
| run: npx jsr publish |