-
-
Notifications
You must be signed in to change notification settings - Fork 93
147 lines (119 loc) · 5.16 KB
/
build.yml
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
name: Build
on:
workflow_dispatch:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: windows-2022
strategy:
fail-fast: true
matrix:
# electron: [29.0.0, 30.0.0, 31.0.0]
electron: [29.0.0]
name: build Electron-${{ matrix.electron }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: ${{ matrix.electron }}
- name: Exit
run: exit 1
# - name: Setup NodeJS
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# cache: 'npm'
# cache-dependency-path: package-lock.json
# - name: Cache node modules
# id: cache-nodemodules
# uses: actions/cache@v4
# env:
# cache-name: cache-node-modules
# with:
# path: node_modules
# key: ${{ matrix.electron }}-${{ hashFiles('package-lock.json') }}
# - name: Setup dotnet
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: '8.0.x' # SDK Version to use; x will use the latest version of the 8.0 channel
# - name: Versions
# run: |
# node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch
# - name: setup electron version
# shell: bash
# run: |
# sed -i -e 's/"electron": "=31.6.0"/"electron": "=${{ matrix.electron }}"/g' package.json
- name: install node-gyp
run: npm i -g node-gyp
- uses: agracio/[email protected]
id: electron_version
with:
value: "${{ matrix.electron }}"
length_from_start: 2
- name: Create release folder
run: |
mkdir "release\ia32\${{ matrix.electron }}"
mkdir "release\x64\${{ matrix.electron }}"
mkdir "release\arm64\${{ matrix.electron }}"
- name: Build ia32
timeout-minutes: 30
run: |
node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32
cmd /c copy /y build\Release\edge_*.node release\ia32\${{ matrix.electron }}
cmd /c rmdir /S /Q build
- name: Build x64
timeout-minutes: 30
run: |
node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64
cmd /c copy /y build\Release\edge_*.node release\x64\${{ matrix.electron }}
cmd /c rmdir /S /Q build
- name: Build arm64
timeout-minutes: 30
shell: pwsh
run: |
node-gyp configure --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64
(Get-Content -Raw build/build_managed.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\arm64\${{ matrix.electron }}
cmd /c rmdir /S /Q build
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: ${{ matrix.electron }}
path: |
release
test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
# electron: [29.4.6, 30.5.1, 31.6.0]
electron: [29.4.6]
os: [windows-2022]
fail-fast: false
name: test
steps:
- uses: agracio/[email protected]
id: electron_version
with:
value: ${{ matrix.electron }}
length_from_start: 2
- name: Create release folder
run: |
cmd /c if not exist "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0"
cmd /c if not exist "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0"
cmd /c if not exist "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0"
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: release
pattern: ${{ steps.electron_version.outputs.substring }}.0.0*
- run: ls -R release
- run: ls -R