Skip to content

Commit a79ffbd

Browse files
Merge pull request #16 from confused-Techie/master
Implement automatic publishing to NPM
2 parents de97b49 + 14e4a06 commit a79ffbd

File tree

15 files changed

+33312
-10563
lines changed

15 files changed

+33312
-10563
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
node_version:
1818
- 14
1919
- 16
20-
- 18
2120
exclude:
2221
- os: windows-latest
2322
node_version: 14
@@ -80,6 +79,7 @@ jobs:
8079
if: ${{ runner.os != 'Windows' }}
8180
run: |
8281
source CI_venv/bin/activate
82+
npm config set python "$(which python3)"
8383
npm install
8484
8585
- name: Install dependencies (Windows)

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: NPM Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
env:
9+
NODE_VERSION: 16
10+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ env.NODE_VERSION }}
20+
registry-url: https://registry.npmjs.org/
21+
- name: Install Python setuptools
22+
# Reasoning for this in `ci.yml`
23+
run: |
24+
python3 -m venv CI_venv
25+
source CI_venv/bin/activate
26+
python3 -m pip install setuptools
27+
- name: Install Dependencies
28+
run: |
29+
source CI_venv/bin/activate
30+
npm config set python "$(which python3)"
31+
npm ci
32+
- run: |
33+
npm run test:node
34+
npm run test:native
35+
- run: npm publish --access public

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ ext
66

77
/browser.js
88
emsdk-portable
9-
package-lock.json
109

1110
vendor/libiconv

benchmark/native/marker-index-benchmark.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <iostream>
33
#include <vector>
44
#include <stdlib.h>
5-
#include "catch.hpp"
5+
#include "catch_amalgamated.hpp"
66
#include "point.h"
77
#include "range.h"
88
#include "marker-index.h"

binding.gyp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
}
8686
}],
8787
['OS=="win"', {
88-
'sources': [
88+
'sources': [
8989
'vendor/win-iconv/win_iconv.c',
9090
],
9191
'include_dirs': [
@@ -148,10 +148,16 @@
148148
"targets": [{
149149
"target_name": "tests",
150150
"type": "executable",
151+
"cflags_cc": ["-std=c++17"],
151152
"cflags_cc!": ["-fno-exceptions"],
152153
"defines": [
153-
"CATCH_CONFIG_CPP11_NO_IS_ENUM"
154+
"CATCH_CONFIG_CPP11_NO_IS_ENUM",
155+
"CATCH_CONFIG_CPP17_STRING_VIEW"
154156
],
157+
'xcode_settings': {
158+
'CLANG_CXX_LIBRARY': 'libc++',
159+
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
160+
},
155161
"sources": [
156162
"test/native/test-helpers.cc",
157163
"test/native/tests.cc",
@@ -160,6 +166,7 @@
160166
"test/native/text-buffer-test.cc",
161167
"test/native/text-test.cc",
162168
"test/native/text-diff-test.cc",
169+
"vendor/catch_amalgamated.cpp"
163170
],
164171
"include_dirs": [
165172
"vendor",
@@ -175,7 +182,7 @@
175182
],
176183
"xcode_settings": {
177184
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
178-
'MACOSX_DEPLOYMENT_TARGET': '10.8',
185+
'MACOSX_DEPLOYMENT_TARGET': '10.12',
179186
}
180187
}]
181188
]
@@ -189,7 +196,8 @@
189196
['OS=="mac"', {
190197
"xcode_settings": {
191198
'CLANG_CXX_LIBRARY': 'libc++',
192-
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
199+
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
200+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
193201
}
194202
}],
195203
['OS=="win"', {

0 commit comments

Comments
 (0)