Skip to content

Commit 27505a6

Browse files
committed
patch: migrate to prebuilidify + flowzone + upgrade all deps
1 parent d6179f4 commit 27505a6

11 files changed

Lines changed: 3081 additions & 142 deletions

File tree

.github/actions/test/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: test release
3+
# https://github.com/product-os/flowzone/tree/master/.github/actions
4+
inputs:
5+
json:
6+
description: "JSON stringified object containing all the inputs from the calling workflow"
7+
required: true
8+
secrets:
9+
description: "JSON stringified object containing all the secrets from the calling workflow"
10+
required: true
11+
12+
# --- custom environment
13+
NODE_VERSION:
14+
type: string
15+
default: "18.x"
16+
VERBOSE:
17+
type: string
18+
default: "true"
19+
20+
runs:
21+
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
22+
using: "composite"
23+
steps:
24+
- name: Setup Node.js
25+
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
26+
with:
27+
node-version: ${{ inputs.NODE_VERSION }}
28+
cache: npm
29+
30+
- name: Test release
31+
shell: bash
32+
run: |
33+
npm ci
34+
npm run build
35+
npm run test

.github/workflows/flowzone.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Flowzone
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, closed]
6+
branches: [main, master]
7+
# allow external contributions to use secrets within trusted code
8+
pull_request_target:
9+
types: [opened, synchronize, closed]
10+
branches: [main, master]
11+
12+
jobs:
13+
flowzone:
14+
name: Flowzone
15+
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
16+
# prevent duplicate workflow executions for pull_request and pull_request_target
17+
if: |
18+
(
19+
github.event.pull_request.head.repo.full_name == github.repository &&
20+
github.event_name == 'pull_request'
21+
) || (
22+
github.event.pull_request.head.repo.full_name != github.repository &&
23+
github.event_name == 'pull_request_target'
24+
)
25+
26+
# Workflows in the same org or enterprise can use the inherit keyword to implicitly pass secrets
27+
secrets: inherit
28+
with:
29+
custom_test_matrix: >
30+
{
31+
"os": [["windows-2019"], ["macos-latest"]]
32+
}
33+
restrict_custom_actions: false

.travis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,78 @@
1-
mountutils
2-
==========
1+
# mountutils
32

43
[![npm](https://img.shields.io/npm/v/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)
54
[![npm license](https://img.shields.io/npm/l/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)
65
[![npm downloads](https://img.shields.io/npm/dm/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)
7-
[![Travis CI status](https://img.shields.io/travis/resin-io-modules/mountutils/master.svg?style=flat-square&label=linux%20|%20mac)](https://travis-ci.org/resin-io-modules/mountutils/branches)
8-
[![AppVeyor status](https://img.shields.io/appveyor/ci/resin-io/mountutils/master.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/resin-io/mountutils/branch/master)
96

107
> Cross platform mount related utilities
118
12-
Installation
13-
------------
9+
## Installation
1410

1511
Install `mountutils` by running:
1612

1713
```sh
1814
$ npm install --save mountutils
1915
```
2016

21-
Debug mode
22-
----------
17+
## Prebuild
18+
19+
This project contains cross-platform prebuild for node 18.18.2 and 20.5.1.
20+
21+
## Debug mode
2322

2423
You can enable debug mode by setting the `MOUNTUTILS_DEBUG` environment
2524
variable.
2625

27-
Documentation
28-
-------------
26+
## Documentation
2927

3028
<a name="module_mountutils.unmountDisk"></a>
3129

3230
### mountutils.unmountDisk(device, callback)
31+
3332
**Kind**: static method of <code>[mountutils](#module_mountutils)</code>
3433
**Summary**: Unmount a whole disk
35-
**Access**: public
34+
**Access**: public
3635

37-
| Param | Type | Description |
38-
| --- | --- | --- |
39-
| device | <code>String</code> | device |
36+
| Param | Type | Description |
37+
| -------- | --------------------- | ---------------- |
38+
| device | <code>String</code> | device |
4039
| callback | <code>function</code> | callback (error) |
4140

42-
**Example**
41+
**Example**
42+
4343
```js
4444
// macOS
45-
const drive = '/dev/disk2';
45+
const drive = "/dev/disk2";
4646

4747
// GNU/Linux
48-
const drive = '/dev/sdb';
48+
const drive = "/dev/sdb";
4949

5050
// Windows
51-
const drive = '\\\\.\\PHYSICALDRIVE2';
51+
const drive = "\\\\.\\PHYSICALDRIVE2";
5252

5353
mountutils.unmountDisk(drive, (error) => {
5454
if (error) {
5555
throw error;
5656
}
5757

58-
console.log('Done!');
58+
console.log("Done!");
5959
});
6060
```
6161

62-
Support
63-
-------
62+
## Support
6463

6564
If you're having any problem, please [raise an issue][newissue] on GitHub and
6665
the Resin.io team will be happy to help.
6766

68-
Tests
69-
-----
67+
## Tests
7068

7169
Run the test suite by doing:
7270

7371
```sh
7472
$ npm test
7573
```
7674

77-
Troubleshooting
78-
---------------
75+
## Troubleshooting
7976

8077
### `error C2373: '__pfnDliNotifyHook2': redefinition`
8178

@@ -88,8 +85,7 @@ npm install -g npm@latest
8885

8986
See the [following `node-gyp` issue](https://github.com/nodejs/node-gyp/issues/972) for more details.
9087

91-
Contribute
92-
----------
88+
## Contribute
9389

9490
- Issue Tracker: [github.com/resin-io-modules/mountutils/issues][issues]
9591
- Source Code: [github.com/resin-io-modules/mountutils][source]
@@ -105,8 +101,7 @@ linters run without any warning:
105101
$ npm run lint
106102
```
107103

108-
License
109-
-------
104+
## License
110105

111106
The project is licensed under the Apache 2.0 license.
112107

appveyor.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

binding.gyp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,7 @@
6363
],
6464
}
6565
],
66+
'variables' : {
67+
'openssl_fips': '',
68+
},
6669
}

index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @module mountutils
1919
*/
2020

21-
'use strict';
21+
"use strict";
2222

2323
/**
2424
* @summary Unmount a whole disk
@@ -49,9 +49,8 @@
4949
* });
5050
*/
5151

52-
module.exports = require('bindings')({
53-
bindings: 'MountUtils',
54-
/* eslint-disable camelcase */
55-
module_root: __dirname
56-
/* eslint-enable camelcase */
57-
});
52+
// Will load a compiled build if present or a prebuild.
53+
// If no build if found it will throw an exception
54+
const binding = require('node-gyp-build')(__dirname);
55+
56+
module.exports = binding;

0 commit comments

Comments
 (0)