Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement automatic publishing to NPM #16

Merged
merged 20 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
80aacfe
Use basic testing mechanism like we use elsewhere
confused-Techie Feb 1, 2025
c04236f
Match install steps to `ci.yml` allow `package.json` update to be wri…
confused-Techie Feb 1, 2025
f3e32e3
Apply automatic changes
confused-Techie Feb 1, 2025
0a3c5da
Revert "Apply automatic changes"
confused-Techie Feb 1, 2025
e2e156f
Ensure `package-lock.json` content is allowed within the repo, ignore…
confused-Techie Feb 1, 2025
8b6588d
Apply automatic changes
confused-Techie Feb 1, 2025
94fe796
Remove ability to write lock file. Match test methodology
confused-Techie Feb 1, 2025
6d56d72
Fix indentation of workflow file
confused-Techie Feb 1, 2025
40cf2c9
Finalize publication steps
confused-Techie Feb 1, 2025
789a3b6
Stop testing CI on NodeJS v18
confused-Techie Feb 1, 2025
0b58fbb
Add support for the `CP437` character on macOS
confused-Techie Feb 1, 2025
5396463
Remove prepublish actions
confused-Techie Feb 1, 2025
422defc
Update .github/workflows/publish.yml
confused-Techie Feb 1, 2025
5933fb4
Apply changes to find the right python version to tests
confused-Techie Feb 1, 2025
d4ad928
Update Catch2…
savetheclocktower Sep 19, 2024
7614645
Update other references to `catch.hpp`
savetheclocktower Feb 1, 2025
c5f6fae
Fix assertions
savetheclocktower Feb 2, 2025
891d408
Bump the minimum deployment target as required by Catch2, apparently
savetheclocktower Feb 2, 2025
daddbad
Fix typos in `binding.gyp`
savetheclocktower Feb 2, 2025
14e4a06
Merge pull request #1 from savetheclocktower/possible-rng-fix
confused-Techie Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
node_version:
- 14
- 16
- 18
exclude:
- os: windows-latest
node_version: 14
Expand Down Expand Up @@ -80,6 +79,7 @@ jobs:
if: ${{ runner.os != 'Windows' }}
run: |
source CI_venv/bin/activate
npm config set python "$(which python3)"
npm install

- name: Install dependencies (Windows)
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: NPM Publish

on:
release:
types: [created]
workflow_dispatch:

env:
NODE_VERSION: 16
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- name: Install Python setuptools
# Reasoning for this in `ci.yml`
run: |
python3 -m venv CI_venv
source CI_venv/bin/activate
python3 -m pip install setuptools
- name: Install Dependencies
run: |
source CI_venv/bin/activate
npm config set python "$(which python3)"
npm ci
- run: |
npm run test:node
npm run test:native
- run: npm publish --access public
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ ext

/browser.js
emsdk-portable
package-lock.json

vendor/libiconv
2 changes: 1 addition & 1 deletion benchmark/native/marker-index-benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <iostream>
#include <vector>
#include <stdlib.h>
#include "catch.hpp"
#include "catch_amalgamated.hpp"
#include "point.h"
#include "range.h"
#include "marker-index.h"
Expand Down
16 changes: 12 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}
}],
['OS=="win"', {
'sources': [
'sources': [
'vendor/win-iconv/win_iconv.c',
],
'include_dirs': [
Expand Down Expand Up @@ -148,10 +148,16 @@
"targets": [{
"target_name": "tests",
"type": "executable",
"cflags_cc": ["-std=c++17"],
"cflags_cc!": ["-fno-exceptions"],
"defines": [
"CATCH_CONFIG_CPP11_NO_IS_ENUM"
"CATCH_CONFIG_CPP11_NO_IS_ENUM",
"CATCH_CONFIG_CPP17_STRING_VIEW"
],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
},
"sources": [
"test/native/test-helpers.cc",
"test/native/tests.cc",
Expand All @@ -160,6 +166,7 @@
"test/native/text-buffer-test.cc",
"test/native/text-test.cc",
"test/native/text-diff-test.cc",
"vendor/catch_amalgamated.cpp"
],
"include_dirs": [
"vendor",
Expand All @@ -175,7 +182,7 @@
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
'MACOSX_DEPLOYMENT_TARGET': '10.8',
'MACOSX_DEPLOYMENT_TARGET': '10.12',
}
}]
]
Expand All @@ -189,7 +196,8 @@
['OS=="mac"', {
"xcode_settings": {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
}
}],
['OS=="win"', {
Expand Down
Loading