This repository was archived by the owner on Jul 3, 2023. It is now read-only.
Repository navigation
108 lines (98 loc) · 3.63 KB
/
Copy pathci.yml
File metadata and controls
108 lines (98 loc) · 3.63 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
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- released
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node:
- 14
- 16
- 18
name: Node ${{ matrix.node }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Update node-gyp
if: ${{ matrix.os == 'windows-latest' && matrix.node == '14' }}
run: |
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
$NodeDirPath = Split-Path $WhereNode -Parent
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\npm-lifecycle"
cd $NodeModulesPath
npm install node-gyp@9.x
- name: Install dependencies
run: npm install
- name: Lint
run: npm run standard
- name: Run tests
run: |
npm run test:node
npm run test:native
publish:
if: ${{ github.event_name == 'release' }}
name: Publishing to NPM
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
prebuild:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
name: Prebuild on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: publish
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install --ignore-scripts
- 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 -t 20.0.0 -u ${{ secrets.GH_TOKEN }}
# Prebuilding for Electron on Windows fails with
# win_delay_load_hook.cc
# 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]
- if: matrix.os != 'windows-latest'
run: npx --no-install prebuild -r electron -t 21.0.0 -t 22.0.0 -t 23.0.0 -u ${{ secrets.GH_TOKEN }}
# - if: matrix.os == 'windows-latest'
# 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 }}
- if: matrix.os == 'macos-latest'
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 }}