Initial commit #1
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: Build libnode (Windows) | |
| # Builds Node.js as a shared library (libnode.dll) on a Windows runner and | |
| # uploads the V8 headers + libnode binaries as zip artifacts -- the same zips | |
| # the Docker image produces, ready to publish to a CDN for mod_v8 to consume. | |
| # | |
| # Trigger manually (Actions tab -> "Build libnode (Windows)" -> Run workflow) | |
| # choosing the Node tag, or push a tag like `libnode-v20.19.2` to build it. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| node_version: | |
| description: 'Node.js git tag to build (e.g. v20.19.2)' | |
| required: true | |
| default: 'v20.19.2' | |
| configs: | |
| description: 'Configurations to build (space-separated)' | |
| required: true | |
| default: 'Release Debug' | |
| arch: | |
| description: 'Target architecture' | |
| required: true | |
| default: 'x64' | |
| type: choice | |
| options: [x64, arm64] | |
| push: | |
| tags: | |
| - 'libnode-v*' # e.g. push tag `libnode-v20.19.2` | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| timeout-minutes: 300 | |
| permissions: | |
| contents: write # needed to attach zips to a Release on tag push | |
| steps: | |
| - name: Checkout builder | |
| uses: actions/checkout@v4 | |
| - name: Resolve build parameters | |
| id: p | |
| shell: pwsh | |
| run: | | |
| if ($env:GITHUB_EVENT_NAME -eq 'push') { | |
| # tag form: libnode-v20.19.2 -> node tag v20.19.2 | |
| $nv = "$env:GITHUB_REF_NAME" -replace '^libnode-', '' | |
| $cfg = 'Release Debug' | |
| $arch = 'x64' | |
| } else { | |
| $nv = '${{ inputs.node_version }}' | |
| $cfg = '${{ inputs.configs }}' | |
| $arch = '${{ inputs.arch }}' | |
| } | |
| "node_version=$nv" >> $env:GITHUB_OUTPUT | |
| "configs=$cfg" >> $env:GITHUB_OUTPUT | |
| "arch=$arch" >> $env:GITHUB_OUTPUT | |
| Write-Host "Building Node $nv [$cfg] for $arch" | |
| # Node 20.x's configure rejects Python 3.14; 3.13 is accepted by Node 20..26. | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| # NASM is required for OpenSSL's x64 assembler modules and is not preinstalled. | |
| - name: Install NASM | |
| shell: pwsh | |
| run: choco install -y --no-progress nasm | |
| # Rust (cargo/rustc) is only needed for Node >= 26 (Temporal builds the | |
| # deps/crates). The windows-2022 image ships Rust preinstalled; this just | |
| # confirms it's on PATH and is a no-op for Node 20/22. | |
| - name: Verify toolchain | |
| shell: pwsh | |
| run: | | |
| Write-Host "Python : $(python --version 2>&1)" | |
| Write-Host "NASM : $((Get-Command nasm -ErrorAction SilentlyContinue)?.Source)" | |
| Write-Host "cargo : $((Get-Command cargo -ErrorAction SilentlyContinue)?.Source)" | |
| Write-Host "git : $(git --version)" | |
| - name: Build libnode + package zips | |
| shell: pwsh | |
| env: | |
| NODE_VERSION: ${{ steps.p.outputs.node_version }} | |
| CONFIGS: ${{ steps.p.outputs.configs }} | |
| ARCH: ${{ steps.p.outputs.arch }} | |
| OUT_DIR: ${{ github.workspace }}\artifacts | |
| run: .\build-libnode.ps1 | |
| - name: List artifacts | |
| shell: pwsh | |
| run: Get-ChildItem '${{ github.workspace }}\artifacts' | Format-Table Name, Length | |
| - name: Upload zips | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libnode-${{ steps.p.outputs.node_version }}-${{ steps.p.outputs.arch }} | |
| path: | | |
| artifacts/*.zip | |
| artifacts/SHA256SUMS.txt | |
| if-no-files-found: error | |
| retention-days: 30 | |
| # On a tag push, also attach the zips to a GitHub Release for easy download. | |
| - name: Publish to Release | |
| if: github.event_name == 'push' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/*.zip | |
| artifacts/SHA256SUMS.txt |