Build for Windows #3
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 for Windows | |
on: workflow_dispatch | |
jobs: | |
build-x86: | |
runs-on: windows-latest | |
env: | |
WOLFRAM_SYSTEM_ID: Windows-x86-64-v7 | |
WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL: https://files.wolframcdn.com/packages/winget/14.0.0.0/WolframEngine_14.0.0_WIN.msi | |
WOLFRAMENGINE_CACHE_KEY: WolframEngine-B | |
WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY: WolframEngine | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Patch specific dependencies from package.json | |
shell: pwsh | |
run: | | |
$pkgPath = "package.json" | |
$json = Get-Content $pkgPath -Raw | ConvertFrom-Json | |
$dependenciesToRemove = @( | |
"dmg-license", | |
"electron-trackpad-utils" | |
) | |
foreach ($dep in $dependenciesToRemove) { | |
if ($json.dependencies.$dep) { | |
$json.dependencies.PSObject.Properties.Remove($dep) | |
} | |
if ($json.devDependencies.$dep) { | |
$json.devDependencies.PSObject.Properties.Remove($dep) | |
} | |
} | |
$json | ConvertTo-Json -Depth 10 | Out-File -Encoding UTF8 $pkgPath | |
- name: Install Node.js manually | |
run: | | |
Invoke-WebRequest https://nodejs.org/dist/v23.9.0/node-v23.9.0-x64.msi -OutFile nodejs.msi | |
Start-Process msiexec.exe -Wait -ArgumentList '/quiet', '/i', 'nodejs.msi' | |
shell: powershell | |
- name: Check Node version | |
run: | | |
node -v | |
npm -v | |
shell: powershell | |
- name: Install Node.js dependencies | |
run: | | |
npm install | |
- name: Cache/restore Wolfram Engine install | |
id: cache-restore | |
uses: actions/cache@v4 | |
env: | |
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' | |
with: | |
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }} | |
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }} | |
- name: Download and install Wolfram Engine | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
env: | |
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' | |
WOLFRAMENGINE_INSTALL_MSI_PATH: '${{ runner.temp }}\WolframEngine-Install.msi' | |
WOLFRAMENGINE_INSTALL_LOG_PATH: '${{ runner.temp }}\WolframEngine-Install.log' | |
run: | | |
echo 'Downloading Wolfram Engine installer...' | |
$msiFile = '${{ env.WOLFRAMENGINE_INSTALL_MSI_PATH }}' | |
$logFile = '${{ env.WOLFRAMENGINE_INSTALL_LOG_PATH }}' | |
Import-Module BitsTransfer | |
Start-BitsTransfer '${{ env.WOLFRAMENGINE_INSTALL_MSI_DOWNLOAD_URL }}' $msiFile | |
echo 'Downloaded Wolfram Engine installer.' | |
$DataStamp = get-date -Format yyyyMMddTHHmmss | |
$MSIArguments = @( | |
"/i" | |
('"{0}"' -f $msiFile) | |
'INSTALLLOCATION="${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}"' | |
"/qn" | |
"/norestart" | |
"/L*v" | |
$logFile | |
) | |
echo 'Installing Wolfram Engine...' | |
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow | |
echo 'Installed Wolfram Engine.' | |
- name: Bundle files | |
env: | |
WOLFRAMENGINE_INSTALLATION_DIRECTORY: '${{ runner.temp }}\${{ env.WOLFRAMENGINE_INSTALLATION_SUBDIRECTORY }}' | |
WOLFRAMINIT: "-pwfile !cloudlm.wolfram.com -entitlement ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }}" | |
run: | | |
$env:Path += ';${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}\' | |
wolfram -script ./Scripts/bundle.wls | |
- name: Build Electron | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
npm run dist-win86 | |