1
1
name : ci
2
+
2
3
on :
3
- - pull_request
4
- - push
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+ release :
11
+ types :
12
+ - released
5
13
6
14
jobs :
7
- Test :
8
- if : " !contains(github.event.head_commit.message, '[skip ci]')"
15
+ test :
9
16
runs-on : ${{ matrix.os }}
10
17
strategy :
11
18
fail-fast : false
@@ -14,27 +21,31 @@ jobs:
14
21
- ubuntu-latest
15
22
- macos-latest
16
23
- windows-latest
17
- node_version :
24
+ node :
18
25
- 14
19
26
- 16
20
27
- 18
21
- name : Node ${{ matrix.node_version }} on ${{ matrix.os }}
28
+ name : Node ${{ matrix.node }} on ${{ matrix.os }}
22
29
23
30
steps :
24
- - uses : actions/checkout@v2
31
+ - uses : actions/checkout@v3
25
32
with :
26
33
submodules : true
27
- - name : Cache
28
- uses : actions/cache@v2
29
- with :
30
- path : |
31
- 'node_modules'
32
- key : ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json') }}
34
+ fetch-depth : 0
33
35
34
36
- name : Setup node
35
- uses : actions/setup-node@v2-beta
37
+ uses : actions/setup-node@v3
36
38
with :
37
- node-version : ${{ matrix.node_version }}
39
+ node-version : ${{ matrix.node }}
40
+
41
+ - name : Update node-gyp
42
+ if : ${{ matrix.os == 'windows-latest' && matrix.node == '14' }}
43
+ run : |
44
+ $WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
45
+ $NodeDirPath = Split-Path $WhereNode -Parent
46
+ $NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\npm-lifecycle"
47
+ cd $NodeModulesPath
48
+
38
49
39
50
- name : Install dependencies
40
51
run : npm install
47
58
npm run test:node
48
59
npm run test:native
49
60
50
- Skip :
51
- if : contains(github.event.head_commit.message, '[skip ci]')
61
+ publish :
62
+ if : ${{ github.event_name == 'release' }}
63
+ name : Publishing to NPM
52
64
runs-on : ubuntu-latest
65
+ needs : test
66
+ steps :
67
+ - uses : actions/checkout@v3
68
+ with :
69
+ submodules : true
70
+ fetch-depth : 0
71
+ - uses : actions/setup-node@v3
72
+ with :
73
+ node-version : 18
74
+ registry-url : https://registry.npmjs.org
75
+ - run : npm publish --access public
76
+ env :
77
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
78
+
79
+ prebuild :
80
+ strategy :
81
+ matrix :
82
+ os :
83
+ - ubuntu-latest
84
+ - macos-latest
85
+ - windows-latest
86
+ fail-fast : false
87
+ name : Prebuild on ${{ matrix.os }}
88
+ runs-on : ${{ matrix.os }}
89
+ needs : publish
53
90
steps :
54
- - name : Skip CI 🚫
55
- run : echo skip ci
91
+ - uses : actions/checkout@v3
92
+ with :
93
+ submodules : true
94
+ fetch-depth : 0
95
+ - uses : actions/setup-node@v3
96
+ with :
97
+ node-version : 18
98
+ - run : npm install --ignore-scripts
99
+ - run : npx --no-install prebuild -r node -t 10.0.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 -t 18.0.0 -u ${{ secrets.GH_TOKEN }}
100
+ # Prebuilding for Electron on Windows fails with
101
+ # win_delay_load_hook.cc
102
+ # text-buffer-wrapper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStore@v8@@@std@@XZ) referenced in function "public: virtual void __cdecl `private: static void __cdecl TextBufferWrapper::find_words_with_subsequence_in_range(class Nan::FunctionCallbackInfo<class v8::Value> const &)'::`2'::FindWordsWithSubsequenceInRangeWorker::HandleOKCallback(void)" (?HandleOKCallback@FindWordsWithSubsequenceInRangeWorker@?1??find_words_with_subsequence_in_range@TextBufferWrapper@@CAXAEBV?$FunctionCallbackInfo@VValue@v8@@@Nan@@@Z@UEAAXXZ) [D:\a\superstring\superstring\build\superstring.vcxproj]
103
+ - if : matrix.os != 'windows-latest'
104
+ run : npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 -u ${{ secrets.GH_TOKEN }}
105
+ # - if: matrix.os == 'windows-latest'
106
+ # run: npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch ia32 -u ${{ secrets.GH_TOKEN }}
107
+ - if : matrix.os == 'macos-latest'
108
+ run : npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 --arch arm64 -u ${{ secrets.GH_TOKEN }}
0 commit comments