Skip to content

Refactor build command in windows-build.yml: Update NSIS installation… #26

Refactor build command in windows-build.yml: Update NSIS installation…

Refactor build command in windows-build.yml: Update NSIS installation… #26

Workflow file for this run

name: electron-windows-nsis-build
on:
push:
branches:
- "**"
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
node-version: [18.x]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Install global electron-builder
run: npm install -g [email protected]
- name: Check NSIS version
run: |
$nsisPath = "C:\Program Files (x86)\NSIS\makensis.exe"
if (Test-Path $nsisPath) {
Write-Output "NSIS version:"
& $nsisPath /VERSION
} else {
Write-Output "NSIS not found in expected location."
exit 1
}
shell: pwsh
- name: Clear npm cache
run: npm cache clean --force
- name: Install Dependencies
run: pnpm install --prefer-offline --no-frozen-lockfile
working-directory: ./native
- name: Build Electron App
run: pnpm run build
working-directory: ./native
- name: Create NSIS Installer
run: pnpm run electron-builder -- --win --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./native
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./native/release/**/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}