-
Notifications
You must be signed in to change notification settings - Fork 749
689 lines (579 loc) · 27.3 KB
/
server-api-stage.yml
File metadata and controls
689 lines (579 loc) · 27.3 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
name: API Server Build Stage
on:
workflow_run:
workflows: ['Release Apps Stage']
branches:
- stage-apps
- temp
types:
- completed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
release-linux:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [ubicloud-standard-8]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v6
with:
node-version: 24.14.0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.nx/cache
key: ${{ runner.os }}-${{ runner.arch }}-yarn-nx-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-nx-
${{ runner.os }}-${{ runner.arch }}-yarn-
- name: Change permissions
run: 'sudo chown -R $(whoami) ./*'
- name: Install system dependencies
run: 'sudo apt-get update && sudo apt install -y curl gnupg git libappindicator3-1 ca-certificates binutils icnsutils graphicsmagick'
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Fix node-gyp and Python
run: python3 -m pip install packaging setuptools
- name: Install latest version of NPM
run: 'sudo npm install -g npm@11.6.2'
- name: Install globally node-gyp, ts-node and nx packages
run: 'sudo npm install --quiet -g node-gyp@10.2.0 ts-node@10.9.2 nx@^22.5.2'
- name: Configure Registry
shell: bash
run: |
if [ -n "${{ secrets.VERDACCIO_TOKEN }}" ]; then
echo "//packages.ever.co/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" >> .npmrc
echo "registry=https://packages.ever.co/" >> .npmrc
echo "always-auth=true" >> .npmrc
echo 'registry "https://packages.ever.co/"' >> .yarnrc
sed -i.bak 's|https://registry.yarnpkg.com|https://packages.ever.co|g' yarn.lock
sed -i.bak 's|https://registry.npmjs.org|https://packages.ever.co|g' yarn.lock
rm -f yarn.lock.bak
fi
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
- name: Run Postinstall Manually
run: 'yarn postinstall.manual'
- name: Bump server version
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_API_SERVER_APP_NAME: 'gauzy-api-server'
DESKTOP_API_SERVER_REPO_NAME: 'ever-gauzy-api-server'
DESKTOP_API_SERVER_REPO_OWNER: 'ever-co'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_API_SERVER_APP_DESCRIPTION: 'Gauzy API Server'
DESKTOP_API_SERVER_APP_ID: 'com.ever.gauzyapiserver'
- name: Ensure dist directory exists
shell: bash
run: mkdir -p dist/packages
- name: Build Server
run: 'yarn build:gauzy-api-server:linux:release:gh:x64'
env:
USE_HARD_LINKS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_NO_CLOUD: false
NX_DAEMON: false
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
release-linux-arm64:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [ubicloud-standard-8-arm]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v6
with:
node-version: 24.14.0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.nx/cache
key: ${{ runner.os }}-${{ runner.arch }}-yarn-nx-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-nx-
${{ runner.os }}-${{ runner.arch }}-yarn-
- name: Change permissions
run: 'sudo chown -R $(whoami) ./*'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt install -y curl gnupg git libappindicator3-1 ca-certificates binutils icnsutils graphicsmagick libx11-dev libxtst-dev libxt-dev libxinerama-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxkbfile-dev libxrandr-dev ruby ruby-dev rubygems build-essential
sudo gem install --no-document fpm
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Install Multipass
run: 'sudo snap install multipass'
- name: Fix node-gyp and Python
run: python3 -m pip install packaging setuptools
- name: Install latest version of NPM
run: 'sudo npm install -g npm@11.6.2'
- name: Install globally node-gyp, ts-node and nx packages
run: 'sudo npm install --quiet -g node-gyp@10.2.0 ts-node@10.9.2 nx@^22.5.2'
- name: Configure Registry
shell: bash
run: |
if [ -n "${{ secrets.VERDACCIO_TOKEN }}" ]; then
echo "//packages.ever.co/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" >> .npmrc
echo "registry=https://packages.ever.co/" >> .npmrc
echo "always-auth=true" >> .npmrc
echo 'registry "https://packages.ever.co/"' >> .yarnrc
sed -i.bak 's|https://registry.yarnpkg.com|https://packages.ever.co|g' yarn.lock
sed -i.bak 's|https://registry.npmjs.org|https://packages.ever.co|g' yarn.lock
rm -f yarn.lock.bak
fi
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
- name: Run Postinstall Manually
run: 'yarn postinstall.manual'
- name: Bump version server api app
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_API_SERVER_APP_NAME: 'gauzy-api-server'
DESKTOP_API_SERVER_REPO_NAME: 'ever-gauzy-api-server'
DESKTOP_API_SERVER_REPO_OWNER: 'ever-co'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_API_SERVER_APP_DESCRIPTION: 'Gauzy API Server'
DESKTOP_API_SERVER_APP_ID: 'com.ever.gauzyapiserver'
- name: Ensure dist directory exists
shell: bash
run: mkdir -p dist/packages
- name: Build Server API
run: 'yarn build:gauzy-api-server:linux:release:gh:arm64'
env:
USE_HARD_LINKS: false
USE_SYSTEM_FPM: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_NO_CLOUD: false
NX_DAEMON: false
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
SNAPCRAFT_BUILD_ENVIRONMENT: host
release-mac:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [ghcr.io/cirruslabs/macos-runner:tahoe]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v6
with:
node-version: 24.14.0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.nx/cache
key: ${{ runner.os }}-${{ runner.arch }}-yarn-nx-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-nx-
${{ runner.os }}-${{ runner.arch }}-yarn-
- name: Fix node-gyp and Python
run: python3 -m pip install --break-system-packages packaging setuptools || python3 -m pip install packaging setuptools
- name: Install latest version of NPM
run: 'sudo npm install -g npm@11.6.2'
- name: Install globally node-gyp, ts-node and nx packages
run: 'sudo npm install --quiet -g node-gyp@10.2.0 ts-node@10.9.2 nx@^22.5.2'
- name: Configure Registry
shell: bash
run: |
if [ -n "${{ secrets.VERDACCIO_TOKEN }}" ]; then
echo "//packages.ever.co/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" >> .npmrc
echo "registry=https://packages.ever.co/" >> .npmrc
echo "always-auth=true" >> .npmrc
echo 'registry "https://packages.ever.co/"' >> .yarnrc
sed -i.bak 's|https://registry.yarnpkg.com|https://packages.ever.co|g' yarn.lock
sed -i.bak 's|https://registry.npmjs.org|https://packages.ever.co|g' yarn.lock
rm -f yarn.lock.bak
fi
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
- name: Run Postinstall Manually
run: 'yarn postinstall.manual'
- name: Bump Server version
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_API_SERVER_APP_NAME: 'gauzy-api-server'
DESKTOP_API_SERVER_REPO_NAME: 'ever-gauzy-api-server'
DESKTOP_API_SERVER_REPO_OWNER: 'ever-co'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_API_SERVER_APP_DESCRIPTION: 'Gauzy API Server'
DESKTOP_API_SERVER_APP_ID: 'com.ever.gauzyapiserver'
- name: Prepare Apple API Key
run: |
echo "${{ secrets.APPLE_API_KEY_BASE64 }}" | base64 --decode > /tmp/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
chmod 600 /tmp/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
- name: Ensure dist directory exists
shell: bash
run: mkdir -p dist/packages
- name: Build Server
run: 'yarn build:gauzy-api-server:mac:release'
env:
USE_HARD_LINKS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_NO_CLOUD: false
NX_DAEMON: false
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_APP_PASSWORD: ${{ secrets.APPLE_ID_APP_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_LINK: ${{ secrets.CSC_LINK_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_API_KEY: /tmp/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
release-windows:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [[self-hosted, Windows, X64]]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
clean: false
- name: Selective cleanup (preserve .nx/cache)
shell: powershell
run: |
$ErrorActionPreference = 'SilentlyContinue'
# Stop NX daemon first to release file locks before cleanup (guard for fresh runners without Node)
if (Get-Command npx -ErrorAction SilentlyContinue) { npx nx daemon --stop 2>&1 | Out-Null }
# Remove build artifacts but keep NX cache for faster rebuilds
if (Test-Path "dist") { Remove-Item -Recurse -Force "dist" }
if (Test-Path "node_modules") { Remove-Item -Recurse -Force "node_modules" }
exit 0
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v6
with:
node-version: 24.14.0
- name: Install Visual Studio 2022 Build Tools (VCTools)
shell: powershell
run: |
choco install -y visualstudio2022buildtools --execution-timeout=21600 --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive --norestart"
- name: Configure node-gyp to use VS 2022
shell: powershell
run: |
"GYP_MSVS_VERSION=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
"npm_config_msvs_version=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Fix node-gyp and Python
run: python3 -m pip install packaging setuptools
- name: Setup MSVC (VS 2022 dev env)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install latest version of NPM
run: 'npm install -g npm@11.6.2'
- name: Install globally node-gyp, ts-node and nx packages
run: 'npm install --quiet -g node-gyp@10.2.0 ts-node@10.9.2 nx@^22.5.2'
- name: Configure npm python for node-gyp
shell: powershell
run: |
$py = (Get-Command python.exe).Source
Write-Host "python is: $py"
"npm_config_python=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
"PYTHON=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Configure Registry
shell: bash
run: |
if [ -n "${{ secrets.VERDACCIO_TOKEN }}" ]; then
echo "//packages.ever.co/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" >> .npmrc
echo "registry=https://packages.ever.co/" >> .npmrc
echo "always-auth=true" >> .npmrc
echo 'registry "https://packages.ever.co/"' >> .yarnrc
sed -i.bak 's|https://registry.yarnpkg.com|https://packages.ever.co|g' yarn.lock
sed -i.bak 's|https://registry.npmjs.org|https://packages.ever.co|g' yarn.lock
rm -f yarn.lock.bak
fi
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
- name: Run Postinstall Manually
run: 'yarn postinstall.manual'
- name: Bump Server version
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_API_SERVER_APP_NAME: 'gauzy-api-server'
DESKTOP_API_SERVER_REPO_NAME: 'ever-gauzy-api-server'
DESKTOP_API_SERVER_REPO_OWNER: 'ever-co'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_API_SERVER_APP_DESCRIPTION: 'Gauzy API Server'
DESKTOP_API_SERVER_APP_ID: 'com.ever.gauzyapiserver'
- name: Fix Node.js PATH for child processes
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$nodeExe = (Get-Command node -ErrorAction Stop).Source
$nodePath = Split-Path $nodeExe -Parent
$npmGlobalBin = & npm config get prefix
$localBin = Join-Path $PWD "node_modules\.bin"
$yarnCmd = Get-Command yarn -ErrorAction SilentlyContinue
$yarnPath = if ($yarnCmd) { Split-Path $yarnCmd.Source -Parent } else { "" }
$npmNodeExe = Join-Path $npmGlobalBin "node.exe"
if (-not (Test-Path $npmNodeExe)) { Copy-Item $nodeExe $npmNodeExe -Force }
$localNodeExe = Join-Path $localBin "node.exe"
if (-not (Test-Path $localNodeExe)) { Copy-Item $nodeExe $localNodeExe -Force }
$newPath = "$nodePath;$npmGlobalBin;$localBin;$yarnPath;$($env:PATH)"
"PATH=$newPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
@($nodePath, $npmGlobalBin, $localBin, $yarnPath) | Where-Object { $_ } | ForEach-Object {
$_ | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
}
"NODE=$nodeExe" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"NODE_PATH=$nodePath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
$env:PATH = $newPath
[System.Environment]::SetEnvironmentVariable("PATH", $newPath, "Process")
- name: Ensure dist directory exists
shell: bash
run: mkdir -p dist/packages
- name: Increase file handle limits
shell: powershell
run: |
# Increase Node.js UV threadpool for parallel I/O (default is 4)
"UV_THREADPOOL_SIZE=32" | Out-File -FilePath $env:GITHUB_ENV -Append
# Patch graceful-fs to retry EMFILE errors with backoff
node -e "try { var gfs = require('graceful-fs'); gfs.gracefulify(require('fs')); console.log('graceful-fs patched'); } catch(e) { console.log('graceful-fs not available, skipping'); }"
- name: Reset NX
shell: powershell
run: npx nx reset
- name: Build Server
shell: cmd
run: 'yarn build:gauzy-api-server:windows:release:gh:x64'
env:
USE_HARD_LINKS: false
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}\.cache\electron-builder
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_NO_CLOUD: true
NX_PLUGIN_NO_TIMEOUTS: true
NX_DAEMON: false
release-windows-arm64:
runs-on: ${{ matrix.os }}
timeout-minutes: 300
strategy:
matrix:
os: [windows-11-arm]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
clean: false
- name: Selective cleanup (preserve .nx/cache)
shell: powershell
run: |
$ErrorActionPreference = 'SilentlyContinue'
# Stop NX daemon first to release file locks before cleanup (guard for fresh runners without Node)
if (Get-Command npx -ErrorAction SilentlyContinue) { npx nx daemon --stop 2>&1 | Out-Null }
# Remove build artifacts but keep NX cache for faster rebuilds
if (Test-Path "dist") { Remove-Item -Recurse -Force "dist" }
if (Test-Path "node_modules") { Remove-Item -Recurse -Force "node_modules" }
exit 0
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v6
with:
node-version: 24.14.0
architecture: arm64
- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
.nx/cache
key: ${{ runner.os }}-${{ runner.arch }}-yarn-nx-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-nx-
${{ runner.os }}-${{ runner.arch }}-yarn-
- name: Install Visual Studio 2022 Build Tools (VCTools with ARM64)
shell: powershell
run: |
choco install -y visualstudio2022buildtools --execution-timeout=21600 --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --includeRecommended --passive --norestart"
- name: Configure node-gyp to use VS 2022
shell: powershell
run: |
"GYP_MSVS_VERSION=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
"npm_config_msvs_version=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Fix node-gyp and Python
run: python3 -m pip install packaging setuptools
- name: Setup MSVC (VS 2022 dev env)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: arm64
- name: Install latest version of NPM
run: 'npm install -g npm@11.6.2'
- name: Install globally node-gyp, ts-node and nx packages
run: 'npm install --quiet -g node-gyp@10.2.0 ts-node@10.9.2 nx@^22.5.2'
- name: Configure npm python for node-gyp
shell: powershell
run: |
$py = (Get-Command python.exe).Source
Write-Host "python is: $py"
"npm_config_python=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
"PYTHON=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Configure Registry
shell: bash
run: |
if [ -n "${{ secrets.VERDACCIO_TOKEN }}" ]; then
echo "//packages.ever.co/:_authToken=${{ secrets.VERDACCIO_TOKEN }}" >> .npmrc
echo "registry=https://packages.ever.co/" >> .npmrc
echo "always-auth=true" >> .npmrc
echo 'registry "https://packages.ever.co/"' >> .yarnrc
sed -i.bak 's|https://registry.yarnpkg.com|https://packages.ever.co|g' yarn.lock
sed -i.bak 's|https://registry.npmjs.org|https://packages.ever.co|g' yarn.lock
rm -f yarn.lock.bak
fi
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'
- name: Run Postinstall Manually
run: 'yarn postinstall.manual'
- name: Bump version server api app
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.serverapi(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_API_SERVER_APP_NAME: 'gauzy-api-server'
DESKTOP_API_SERVER_REPO_NAME: 'ever-gauzy-api-server'
DESKTOP_API_SERVER_REPO_OWNER: 'ever-co'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_API_SERVER_APP_DESCRIPTION: 'Gauzy API Server'
DESKTOP_API_SERVER_APP_ID: 'com.ever.gauzyapiserver'
- name: Fix Node.js PATH for child processes
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$nodeExe = (Get-Command node -ErrorAction Stop).Source
$nodePath = Split-Path $nodeExe -Parent
$npmGlobalBin = & npm config get prefix
$localBin = Join-Path $PWD "node_modules\.bin"
$yarnCmd = Get-Command yarn -ErrorAction SilentlyContinue
$yarnPath = if ($yarnCmd) { Split-Path $yarnCmd.Source -Parent } else { "" }
$npmNodeExe = Join-Path $npmGlobalBin "node.exe"
if (-not (Test-Path $npmNodeExe)) { Copy-Item $nodeExe $npmNodeExe -Force }
$localNodeExe = Join-Path $localBin "node.exe"
if (-not (Test-Path $localNodeExe)) { Copy-Item $nodeExe $localNodeExe -Force }
$newPath = "$nodePath;$npmGlobalBin;$localBin;$yarnPath;$($env:PATH)"
"PATH=$newPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
@($nodePath, $npmGlobalBin, $localBin, $yarnPath) | Where-Object { $_ } | ForEach-Object {
$_ | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
}
"NODE=$nodeExe" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"NODE_PATH=$nodePath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
$env:PATH = $newPath
[System.Environment]::SetEnvironmentVariable("PATH", $newPath, "Process")
- name: Ensure dist directory exists
shell: bash
run: mkdir -p dist/packages
- name: Increase file handle limits
shell: powershell
run: |
# Increase Node.js UV threadpool for parallel I/O (default is 4)
"UV_THREADPOOL_SIZE=32" | Out-File -FilePath $env:GITHUB_ENV -Append
# Patch graceful-fs to retry EMFILE errors with backoff
node -e "try { var gfs = require('graceful-fs'); gfs.gracefulify(require('fs')); console.log('graceful-fs patched'); } catch(e) { console.log('graceful-fs not available, skipping'); }"
- name: Build Server API
shell: cmd
run: yarn build:gauzy-api-server:windows:release:gh:arm64
env:
USE_HARD_LINKS: false
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}\.cache\electron-builder
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_NO_CLOUD: true
NX_PLUGIN_NO_TIMEOUTS: true
NX_DAEMON: false