Skip to content

Commit 687f8d8

Browse files
[#38] Add node 10/12 windows builds (#41)
* [#38] add node 12 windows build * [#38] upgrade yarn to 1.22.0 * [#38] try installing NVS in before_install * [#38] move nvs into maybe-install-node.sh and disable non windows build jobs for now * [#38] fix .travis.yml * [#38] use nvs 1.5.4 * [#38] build only windows for now * [#38] use TRAVIS_NODE_VERSION for nvs * [#38] add os: win32 to package.json * [#38] add win32 to rustup * [#38] exec node-pre-gyp from the cwd * [#38] fix typo * [#38] re-enable Linux - Node 10 build * [#38] exec node-pre-gyp from TLD * [#38] try ./node_modules again * Early exist windows testing * Use fully qualified path to pre-gyp binary * Remove windows test build script * Try to stop Windows builds from hanging * Re-enable all build combinations * [#38] only install msvc rust target if on windows; clean up * [#38] only install msvc rust target if on windows attempt 2 * [#38] only install msvc rust target if on windows (attempt 3) * [#38] update version to 0.7.1; update README * Remove old commented out line in build file Co-authored-by: Ernie Turner <ernie.turner@gmail.com>
1 parent 2120294 commit 687f8d8

File tree

6 files changed

+47
-7
lines changed

6 files changed

+47
-7
lines changed

.travis.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,28 @@ jobs:
5555
- TRAVIS_NODE_VERSION="12"
5656
- SKIP_DEPLOY=0
5757
if: tag =~ /^\d+\.\d+\.\d+/ OR branch = master OR type = pull_request
58-
58+
- name: "Windows - Node 10"
59+
os: windows
60+
env:
61+
# Stop Windows builds from hanging after completion https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336
62+
- YARN_GPG=no
63+
- TRAVIS_NODE_VERSION="10"
64+
- SKIP_DEPLOY=0
65+
install:
66+
- rustup target add x86_64-pc-windows-msvc
67+
- source .travis_scripts/maybe-install-node.sh
68+
if: tag =~ /^\d+\.\d+\.\d+/ OR branch = master OR type = pull_request
69+
- name: "Windows - Node 12"
70+
os: windows
71+
env:
72+
# Stop Windows builds from hanging after completion https://travis-ci.community/t/timeout-after-build-finished-and-succeeded/1336
73+
- YARN_GPG=no
74+
- TRAVIS_NODE_VERSION="12"
75+
- SKIP_DEPLOY=0
76+
install:
77+
- rustup target add x86_64-pc-windows-msvc
78+
- source .travis_scripts/maybe-install-node.sh
79+
if: tag =~ /^\d+\.\d+\.\d+/ OR branch = master OR type = pull_request
5980
# Publish to npm only on release tag
6081
- stage: publish
6182
name: "Publish to npm"
@@ -76,6 +97,7 @@ jobs:
7697
before_install:
7798
- ./.travis_scripts/maybe-start-docker.sh
7899

100+
# this install not used by windows builds
79101
install:
80102
- source .travis_scripts/maybe-install-node.sh
81103

.travis_scripts/maybe-install-node.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
# Installs correct node and yarn versions if we aren't doing a docker build.
44

55
if [ -z "${IMAGE}" ] ; then
6+
7+
# install node via NVS -- supports Linux, OS X, and Windows
8+
git clone --branch v1.5.4 --depth 1 https://github.com/jasongin/nvs ~/.nvs
9+
. ~/.nvs/nvs.sh
10+
nvs --version
11+
nvs add $TRAVIS_NODE_VERSION
12+
nvs use $TRAVIS_NODE_VERSION
13+
node --version
14+
615
# install our own yarn to make things work on osx
7-
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.10.1
16+
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
817
export PATH=$HOME/.yarn/bin:$PATH
918

10-
# install our own nodejs to get a reasonable version if outside docker
11-
rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
1219
fi

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.7.1
2+
3+
### Changed
4+
5+
- Added support for Node 10/12 on Windows
6+
17
## 0.7.0
28

39
### Breaking Changes

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This library uses the [Neon Bindings](https://www.neon-bindings.com) toolchain t
1414
| Linux x64 - glibc |||
1515
| Linux x64 - musl-libc |||
1616
| OSX x64 |||
17+
| Windows x64 |||
18+
| Windows x64 |||
1719

1820
## Install
1921

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ironcorelabs/recrypt-node-binding",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "Bindings to allow the recrypt-rs library to work via NodeJS.",
55
"repository": {
66
"type": "git",
@@ -16,7 +16,8 @@
1616
},
1717
"os": [
1818
"darwin",
19-
"linux"
19+
"linux",
20+
"win32"
2021
],
2122
"cpu": [
2223
"x64"

publish.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ fs.writeFileSync("./dist/package.json", JSON.stringify(npmPackageJson, null, 2))
5252

5353
shell.mkdir("./bin-package");
5454
shell.cp("./native/index.node", "./bin-package");
55-
shell.exec("./node_modules/.bin/node-pre-gyp package");
55+
//Use a fully qualified path to pre-gyp binary for Windows support
56+
const cwd = shell.pwd().toString();
57+
shell.exec(`${cwd}/node_modules/node-pre-gyp/bin/node-pre-gyp package`);
5658
var tgz = shell.exec("find ./build -name *.tar.gz");
5759
shell.cp(tgz, "./bin-package/");
5860
shell.pushd("./dist");

0 commit comments

Comments
 (0)