forked from agracio/electron-edge-js
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (91 loc) · 2.9 KB
/
build-edge.yml
File metadata and controls
102 lines (91 loc) · 2.9 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
name: Pipeline Segment - build electron-edge-js
on:
workflow_call:
inputs:
electron:
description: 'Electron major version'
required: true
type: string
os:
description: 'OS'
required: true
type: string
environment:
description: 'environment'
required: false
default: 'build electron-edge-js'
type: string
arch:
description: 'arch'
required: false
default: ''
type: string
platform:
description: 'OS short name'
required: true
type: string
jobs:
build-electron:
runs-on: ${{ inputs.os }}
environment: ${{ inputs.environment }}
# name: build electron-${{ inputs.electron }} ${{ inputs.os }} ${{ inputs.arch }}
name: build-${{ inputs.platform }}-${{ inputs.arch }}-electron-${{ inputs.electron }}
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: '${{ inputs.electron }}.0.0'
os: ${{ inputs.os }}
- name: install node-gyp
shell: bash
run: npm i -g node-gyp
- name: Create release folder
uses: actions/github-script@v7
with:
result-encoding: string
script: |
try {
const fs = require('fs')
fs.mkdirSync(`release/${process.platform}/${{ inputs.arch }}/${{ inputs.electron }}`, { recursive: true });
} catch(err) {
core.error("Error creating release directory")
core.setFailed(err)
}
- if: runner.os == 'Windows'
name: Cache node-gyp Windows
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~\AppData\Local\node-gyp\Cache
key: 'node-gyp-${{ runner.os }}-${{ inputs.arch }}-${{ inputs.electron }}'
- if: runner.os == 'macOS'
name: Cache node-gyp macOS
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~/Library/Caches/node-gyp/
key: 'node-gyp-${{ runner.os }}-${{ inputs.arch }}-${{ inputs.electron }}'
- name: Build ${{ inputs.arch }}
uses: ./.github/actions/build
with:
electron: ${{ inputs.electron }}
arch: ${{ inputs.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: runner.os == 'Windows' && success()
with:
name: win32-electron-edge-js-${{ inputs.arch }}-${{ inputs.electron }}
path: |
release
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: runner.os == 'macOS' && success()
with:
name: darwin-electron-edge-js-${{ inputs.arch }}-${{ inputs.electron }}
path: |
release