Skip to content

Commit

Permalink
v1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
bchr02 committed May 13, 2024
1 parent 115ab23 commit bc6f7ff
Show file tree
Hide file tree
Showing 8 changed files with 1,928 additions and 2,204 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 12, 14, 16 ]
node: [ 18, 20 ]
env:
FORCE_COLOR: 1
name: Node ${{ matrix.node }}
Expand All @@ -22,7 +22,14 @@ jobs:
FORCE_COLOR: 0
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: npm

- run: yarn
- run: yarn test
- run: npm install
- run: npm test

- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info
flag-name: run-${{ matrix.node }}
37 changes: 18 additions & 19 deletions bin/node-pre-gyp-github.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#!/usr/bin/env node

const NodePreGypGithub = require('../index.js');
const program = require('commander');
const { program } = require("commander");

program
.command('publish')
.storeOptionsAsProperties()
.description('publishes the contents of .\\build\\stage\\{version} to the current version\'s GitHub release')
.option("-r, --release", "publish immediately, do not create draft")
.option("-s, --silent", "turns verbose messages off")
.action(async function(options){
const opts = {
draft: options.release ? false : true,
verbose: options.silent ? false : true
};
try {
const nodePreGypGithub = new NodePreGypGithub();
await nodePreGypGithub.publish(opts);
} catch (err) {
console.error(`An error occurred whilst publishing:`, err);
process.exit(1);
}
});
.command("publish")
.description("publishes the contents of ./build/stage/{version} to the current version's GitHub release")
.option("-r, --release", "publish immediately, do not create draft")
.option("-s, --silent", "turns verbose messages off")
.action(async (options) => {
const opts = {
draft: !options.release,
verbose: !options.silent,
};
try {
const nodePreGypGithub = new NodePreGypGithub();
await nodePreGypGithub.publish(opts);
} catch (err) {
console.error(`An error occurred whilst publishing:`, err);
process.exit(1);
}
});

program.parseAsync(process.argv);
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ module.exports = class NodePreGypGithub {

createOctokitInstance(token) {
return new Octokit({
baseUrl: 'https://' + this.host,
auth: token,
headers: {
"user-agent": (this.package_json.name) ? this.package_json.name : "node-pre-gyp-github"
}
baseUrl: "https://" + this.host,
auth: token,
userAgent: this.package_json.name ? this.package_json.name : "node-pre-gyp-github",
});
}

Expand Down
Loading

0 comments on commit bc6f7ff

Please sign in to comment.