4.47.2 #29
Workflow file for this run
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: CI | |
| env: | |
| DEBUG: napi:* | |
| APP_NAME: rollup | |
| MACOSX_DEPLOYMENT_TARGET: '10.13' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - support_openharmony | |
| tags: | |
| - 'v*.*.**' | |
| pull_request: | |
| types: | |
| - synchronize | |
| - opened | |
| - reopened | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| # WASM | |
| - host: ubuntu-latest | |
| target: wasm32-unknown-unknown | |
| name: wasm | |
| is-wasm-build: true | |
| build: >- | |
| rustup default nightly-2025-07-25 && | |
| rustup target add wasm32-unknown-unknown && | |
| npm run build:wasm | |
| path: | | |
| wasm/ | |
| .empty | |
| - host: ubuntu-latest | |
| target: wasm32-unknown-unknown | |
| name: wasm-node | |
| is-wasm-build: true | |
| build: >- | |
| rustup default nightly-2025-07-25 && | |
| rustup target add wasm32-unknown-unknown && | |
| npm run build:wasm:node | |
| path: | | |
| wasm-node/ | |
| .empty | |
| # Linux | |
| - host: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| build: TARGET_CC=clang npm run build:napi -- --release --target x86_64-unknown-linux-gnu --use-napi-cross | |
| - host: ubuntu-latest | |
| target: aarch64-linux-android | |
| build: npm run build:napi -- --release --target aarch64-linux-android --use-napi-cross | |
| - host: ubuntu-latest | |
| target: aarch64-unknown-linux-ohos | |
| build: npm run build:napi -- --release --target aarch64-unknown-linux-ohos | |
| name: Build ${{ matrix.settings.name || matrix.settings.target }} | |
| runs-on: ${{ matrix.settings.host }} | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout Commit | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| if: ${{ !matrix.settings.docker }} | |
| with: | |
| node-version: 24.5.0 | |
| - name: Install Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| if: ${{ !matrix.settings.docker }} | |
| with: | |
| toolchain: nightly-2025-07-25 | |
| targets: ${{ matrix.settings.target }} | |
| - name: Setup OpenHarmony SDK | |
| if: ${{ contains(matrix.settings.target, 'ohos') }} | |
| uses: openharmony-rs/setup-ohos-sdk@52d50de65363f895558a43de0dceb1f8e3679b1c # v0.2.3 | |
| - name: Restore Cargo cache | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| .cargo-cache | |
| rust/target/ | |
| key: ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}-${{ hashFiles('rust/Cargo.lock') }} | |
| restore-keys: ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }} | |
| - uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1 | |
| if: ${{ contains(matrix.settings.target, 'musl') }} | |
| with: | |
| version: 0.14.1 | |
| - name: Install cargo-zigbuild | |
| uses: taiki-e/install-action@5140f853a1cdf11adb558a08d00d06d67af3dea4 # v2.58.11 | |
| if: ${{ contains(matrix.settings.target, 'musl') }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| tool: cargo-zigbuild | |
| - name: Setup toolchain | |
| run: ${{ matrix.settings.setup }} | |
| if: ${{ matrix.settings.setup }} | |
| shell: bash | |
| - name: Restore Node dependencies cache | |
| id: cache-node-modules | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.npm | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: node-modules-${{ runner.os }} | |
| - name: Install Node dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: npm ${{ github.ref == 'refs/heads/master' && 'ci' || 'install' }} --ignore-scripts | |
| - name: Save Node dependencies cache | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' | |
| uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.npm | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| - name: Build in docker | |
| uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # 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 | |
| - name: Save Cargo cache | |
| if: github.ref == 'refs/heads/master' | |
| uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| .cargo-cache | |
| rust/target/ | |
| key: ${{ matrix.settings.name || matrix.settings.target }}-cargo-${{ matrix.settings.host }}-${{ hashFiles('rust/Cargo.lock') }} | |
| - name: Upload wasm artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: bindings-${{ matrix.settings.name }} | |
| path: ${{ matrix.settings.path }} | |
| if-no-files-found: error | |
| if: ${{ matrix.settings.is-wasm-build }} | |
| - name: Upload napi artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: bindings-${{ matrix.settings.target }} | |
| path: ${{ env.APP_NAME }}.*.node | |
| if-no-files-found: error | |
| if: ${{ !matrix.settings.is-wasm-build }} | |
| publish: | |
| permissions: | |
| pull-requests: write # for writing comments | |
| issues: write # for writing comments | |
| contents: write # for creating a release | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout Commit | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| # Necessary to find the commits included in the release | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| check-latest: true | |
| - name: Restore Node dependencies cache | |
| id: cache-node-modules | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.npm | |
| key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: node-modules-${{ runner.os }} | |
| - name: Install Node dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: npm install --ignore-scripts | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| path: artifacts | |
| - name: Copy wasm files | |
| run: cp -R artifacts/bindings-wasm/wasm . | |
| - name: Build JavaScript | |
| run: npm run build:cjs && cp artifacts/*/*.node dist/ && npm run build:bootstrap | |
| - name: Move artifacts | |
| run: npm run ci:artifacts | |
| - name: Publish | |
| run: | | |
| echo "Publishing regular release" | |
| echo '//94.74.105.23:4873/:_authToken="OTMzNDVmZjY5YzUxN2VhYWY2YjBkNGU5MjU2MDQxNWI6ZDYxNDJhMjYyZmQxMDQ="' >> ~/.npmrc | |
| npm publish --access public --registry http://94.74.105.23:4873/ | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| ROLLUP_RELEASE: 'releasing' |