fix: for in/of left lexical binding #320
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: Release | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "!**" | |
| env: | |
| DEBUG: napi:* | |
| APP_NAME: jsshaker | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| CARGO_INCREMENTAL: '1' | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| - host: windows-latest | |
| build: pnpm build --target x86_64-pc-windows-msvc | |
| target: x86_64-pc-windows-msvc | |
| - host: macos-latest | |
| target: x86_64-apple-darwin | |
| setup: rustup target add x86_64-apple-darwin | |
| build: pnpm build --target x86_64-apple-darwin | |
| - host: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian | |
| build: | | |
| cd packages/napi; | |
| export COREPACK_INTEGRITY_KEYS=0; | |
| corepack prepare pnpm --activate; | |
| pnpm build --target x86_64-unknown-linux-gnu | |
| - host: macos-latest | |
| target: aarch64-apple-darwin | |
| build: pnpm build --target aarch64-apple-darwin | |
| - host: ubuntu-latest | |
| target: wasm32-wasip1-threads | |
| build: pnpm build --target wasm32-wasip1-threads | |
| name: ${{ matrix.settings.target }} | |
| runs-on: ${{ matrix.settings.host }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| if: ${{ !matrix.settings.docker }} | |
| with: | |
| node-version: 24 | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install | |
| uses: dtolnay/rust-toolchain@stable | |
| if: ${{ !matrix.settings.docker }} | |
| with: | |
| toolchain: stable | |
| targets: ${{ matrix.settings.target }} | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| .cargo-cache | |
| target/ | |
| key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} | |
| - name: Setup toolchain | |
| run: ${{ matrix.settings.setup }} | |
| if: ${{ matrix.settings.setup }} | |
| shell: bash | |
| - name: Install dependencies | |
| run: pnpm install | |
| working-directory: ./packages/napi | |
| - name: Build in docker | |
| uses: addnab/docker-run-action@v3 | |
| if: ${{ matrix.settings.docker }} | |
| with: | |
| image: ${{ matrix.settings.docker }} | |
| options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build' | |
| run: ${{ matrix.settings.build }} | |
| - name: Build | |
| run: ${{ matrix.settings.build }} | |
| if: ${{ !matrix.settings.docker }} | |
| shell: bash | |
| working-directory: ./packages/napi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bindings-${{ matrix.settings.target }} | |
| path: | | |
| packages/napi/${{ env.APP_NAME }}.*.node | |
| packages/napi/${{ env.APP_NAME }}.*.wasm | |
| if-no-files-found: error | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build index.js | |
| run: pnpm build | |
| working-directory: ./packages/napi | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./packages/napi/artifacts | |
| - name: Move artifacts | |
| run: pnpm artifacts | |
| working-directory: ./packages/napi | |
| - name: List packages | |
| run: ls -R ./npm | |
| shell: bash | |
| working-directory: ./packages/napi | |
| - name: Publish to NPM | |
| continue-on-error: true | |
| run: | | |
| pnpm -r --filter "./packages/napi/npm/**" publish --access public --no-git-checks | |
| pnpm publish ./packages/napi --access public --no-git-checks | |
| pnpm publish ./packages/rollup-plugin --access public --no-git-checks | |
| # - run: node ./scripts/patch.mjs | |
| # working-directory: ./packages/napi | |
| # - run: pnpx pkg-pr-new publish './' './npm/*' --pnpm | |
| # working-directory: ./packages/napi |