Skip to content

Building for windows in a linux runner #343

@lroal

Description

@lroal

Hello, I have a delicate problem.
In gitlab I need to build for win32 / arch64. However, the gitlab runner does not support a windows runner.
And running on npm install on the production server is not an option.

Is this possible to achieve ?
I have tried using the following approach, but get error when running on the production server

....\node_modules\msnodesqlv8\build\Release\sqlserverv8.node is not a valid Win32 application.
build_for_windows:
  stage: build
  image: electronuserland/builder:wine
  before_script:
    # Install UnixODBC development headers and other build essentials
    - apt-get update && apt-get install -y unixodbc-dev build-essential zip

  script:
    # Install Node.js dependencies targeting Windows for Node.js 20
    - npm install --arch=x64 --platform=win32 --target=20.15.1
    
    # Run your build command
    - npm run build  # Ensure this command outputs files to the 'dist' directory
    
  artifacts:
    paths:
      - dist/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions