forked from yorkie-team/codepair
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (86 loc) · 3.25 KB
/
electron-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: electron-build
on: push
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
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: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.4.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Install NSIS (Windows)
if: runner.os == 'Windows'
run: |
choco install nsis -y
echo "C:\Program Files (x86)\NSIS" >> $env:GITHUB_PATH
- name: Verify NSIS installation (Windows)
if: runner.os == 'Windows'
run: |
Get-Command makensis.exe
makensis.exe /VERSION
- name: Clear electron-builder cache (Windows)
if: runner.os == 'Windows'
run: |
Remove-Item -Path "$env:USERPROFILE\AppData\Local\electron-builder\cache" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:USERPROFILE\.electron-gyp" -Recurse -Force -ErrorAction SilentlyContinue
- name: Deploy native project
run: pnpm --filter @codepair/native deploy ./standalone-native
- name: Build/release Electron app (macOS and Linux)
if: runner.os != 'Windows'
env:
GH_TOKEN: ${{ secrets.github_token }}
DEBUG: electron-builder
working-directory: ./standalone-native
run: pnpm run release
- name: Build/release Electron app (Windows)
if: runner.os == 'Windows'
env:
GH_TOKEN: ${{ secrets.github_token }}
DEBUG: electron-builder,electron-builder:*
working-directory: ./standalone-native
run: |
$env:PATH = "C:\Program Files (x86)\NSIS;$env:PATH"
$nsisPath = "C:\Program Files (x86)\NSIS"
$configPath = "electron-builder.yml"
@"
nsis:
oneClick: false
perMachine: false
allowToChangeInstallationDirectory: true
npmRebuild: false
"@ | Out-File -FilePath $configPath -Encoding utf8
# Debug information
Write-Host "NSIS Path: $nsisPath"
Write-Host "PATH environment variable:"
$env:PATH -split ';' | ForEach-Object { Write-Host $_ }
Write-Host "electron-builder version:"
pnpm electron-builder --version
Write-Host "Content of electron-builder.yml:"
Get-Content $configPath
# Run electron-builder with maximum debug output
$env:ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES = "true"
pnpm electron-builder --win --x64 --publish always --config $configPath