-
-
Notifications
You must be signed in to change notification settings - Fork 93
144 lines (122 loc) · 3.87 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
name: Build
on:
workflow_dispatch:
inputs:
build-version:
description: 'Electron version to build'
required: true
default: '30'
type: choice
options:
- 29
- 30
- 31
- 32
- 33
# test-version:
# description: 'Electron version to test build'
# required: true
# default: '31.6.0'
# type: choice
# options:
# - 29.4.6
# - 30.5.1
# - 31.6.0
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
jobs:
build:
runs-on: ${{ matrix.os }}
outputs:
test-version: ${{ steps.electron-test-version.outputs.test-version }}
strategy:
# fail-fast: false
matrix:
os: [windows-2022]
name: build ${{ matrix.os }}-electron-${{ inputs.build-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
# - name: Resolve Electron version from major
# id: electron-test-version
# shell: bash
# run: |
# if [[ ${{ inputs.build-version }} == '29' ]]; then
# echo "test-version=29.4.6" >> $GITHUB_OUTPUT
# elif [[ ${{ inputs.build-version }} == '30' ]]; then
# echo "test-version=30.5.1" >> $GITHUB_OUTPUT
# elif [[ ${{ inputs.build-version }} == '31' ]]; then
# echo "test-version=31.7.5" >> $GITHUB_OUTPUT
# elif [[ ${{ inputs.build-version }} == '32' ]]; then
# echo "test-version=32.2.6" >> $GITHUB_OUTPUT
# elif [[ ${{ inputs.build-version }} == '33' ]]; then
# echo "test-version=33.2.1" >> $GITHUB_OUTPUT
# fi
- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: '${{ inputs.build-version }}.0.0'
os: ${{ matrix.os }}
- name: Get latestElectron version for v${{ inputs.build-version }}
id: electron-test-version
shell: bash
run: |
node tools/getVersion.js ${{ inputs.build-version }}
echo "test-version=$(cat electron.txt)" >> $GITHUB_OUTPUT
- name: install node-gyp
run: npm i -g node-gyp
- name: Create release folder
run: |
mkdir "release\ia32\${{ inputs.build-version }}.0.0"
mkdir "release\x64\${{ inputs.build-version }}.0.0"
mkdir "release\arm64\${{ inputs.build-version }}.0.0"
- name: Cache node-gyp
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~\AppData\Local\node-gyp\Cache
key: '${{ inputs.build-version }}.0.0'
- name: Build ia32
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ inputs.build-version }}
arch: 'ia32'
- name: Build x64
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ inputs.build-version }}
arch: 'x64'
- name: Build arm64
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ inputs.build-version }}
arch: 'arm64'
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: electron-edge-js-${{ inputs.build-version }}.0.0
path: |
release
test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [windows-2022]
# fail-fast: false
name: test ${{ matrix.os }}-v${{ needs.build.outputs.test-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Test build
uses: ./.github/actions/test-build
with:
electron: ${{ needs.build.outputs.test-version }}
os: ${{ matrix.os }}