Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 794c4d3

Browse files
committed
Fix examples to be copy-paste ready
Update ignore files Merge CI and publish actions
1 parent 85d68f9 commit 794c4d3

File tree

16 files changed

+78
-87
lines changed

16 files changed

+78
-87
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI
22

33
on:
44
workflow_dispatch:
5+
release:
56
push:
67
pull_request:
78
branches: [master]
@@ -24,6 +25,8 @@ jobs:
2425
- name: Setup Node
2526
uses: actions/setup-node@v2
2627
with:
28+
# Set registry to NPM instead of github packages for publication
29+
registry-url: 'https://registry.npmjs.org'
2730
node-version: 14
2831

2932
- name: Setup Linux Dependencies
@@ -34,8 +37,23 @@ jobs:
3437
- name: Install Packages
3538
run: npm i --ignore-scripts
3639

40+
# Build only if version tag is not present
3741
- name: Build
3842
run: npm run build -- --all --msvs_version=2019
39-
if: startsWith(github.ref, 'refs/tags/') != true
43+
if: startsWith(github.ref, 'refs/tags/v') != true
4044
env:
4145
ARCH: ${{ matrix.arch }}
46+
47+
# Build and publish if version tag is present
48+
- name: Build & Publish Prebuilds
49+
run: npm run build:ci -- --msvs_version=2019
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
env:
52+
ARCH: ${{ matrix.arch }}
53+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Publish NPM Package
56+
if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'ubuntu')
57+
run: npm publish --access public
58+
env:
59+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

.github/workflows/publish.yml

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

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
.env
21
.idea
32
.vscode
4-
*.DS_Store
5-
*.iml
6-
*.log
7-
binding.gyp
3+
.scratch
84
build
95
builds
106
docs/.vuepress/dist
11-
examples/electron-example/.DS_Store
127
logs
138
node_modules
14-
npm-debug.log*
159
prebuilds
10+
.env
11+
*.DS_Store
12+
*.iml
13+
*.log
14+
examples/**/.DS_Store
15+
npm-debug.log*
1616
stacktrace*
17+
binding.gyp
1718
uiohook.gyp
1819

1920
libuiohook/nbproject/

.lintignore

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
.env
21
.idea
32
.vscode
4-
*.DS_Store
5-
*.iml
6-
*.log
7-
binding.gyp
3+
.scratch
84
build
95
builds
106
docs/.vuepress/dist
11-
examples/electron-example/.DS_Store
127
logs
138
node_modules
14-
npm-debug.log*
159
prebuilds
10+
libuiohook
11+
.env
12+
*.DS_Store
13+
*.iml
14+
*.log
15+
examples/electron-example/.DS_Store
16+
npm-debug.log*
1617
stacktrace*
18+
binding.gyp
1719
uiohook.gyp
18-
libuiohook

.npmignore

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
_config.yml
2-
.env
3-
.github/
4-
.travis.yml
1+
.idea/
52
.vscode/
6-
appveyor.yml
3+
.scratch/
74
build/
85
builds/
6+
docs/.vuepress/dist/
7+
logs/
8+
node_modules/
9+
prebuilds/
10+
libuiohook/
11+
.github/
912
CMakeFiles/
10-
deploy-docs.sh
1113
docs/
1214
examples/
13-
libuiohook/
14-
prebuilds/
1515
test/
16+
.env
17+
*.DS_Store
18+
*.iml
19+
*.log
20+
npm-debug.log*
21+
stacktrace*
1622
/binding.gyp
1723
/uiohook.gyp
24+
.lintignore
25+
.eslintrc.json
26+
.prettierrc.json
27+
_config.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![NPM version](https://img.shields.io/npm/v/iohook?color=%230088FF)](https://www.npmjs.com/package/iohook)
44
[![Release date](https://img.shields.io/github/release-date/wilix-team/iohook?color=%230088FF)](https://github.com/wilix-team/iohook/releases/latest)
55
[![GitHub Super-Linter](https://github.com/wilix-team/iohook/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
6-
[![Publish](https://github.com/wilix-team/iohook/actions/workflows/publish.yml/badge.svg)](https://github.com/wilix-team/iohook/actions/workflows/publish.yml)
6+
[![CI](https://github.com/wilix-team/iohook/actions/workflows/ci.yml/badge.svg)](https://github.com/wilix-team/iohook/actions/workflows/ci.yml)
77
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?color=%23008880)](https://github.com/prettier/prettier)
88
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/iohookjs/Lobby)
99
[![Issues](https://img.shields.io/github/issues-raw/wilix-team/iohook)](https://github.com/wilix-team/iohook/issues)

examples/electron-example/main.js renamed to examples/electron-main/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const { app } = require('electron');
4-
const ioHook = require('../../index');
4+
const ioHook = require('iohook');
55

66
function eventHandler(event) {
77
console.log(event);

examples/electron-example/package.json renamed to examples/electron-main/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"description": "Show how to use this module with electron",
55
"main": "main.js",
66
"scripts": {
7-
"start": "electron ./",
8-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"start": "electron ."
98
},
109
"author": "Aloyan Dmitry",
1110
"license": "MIT",
1211
"dependencies": {
13-
"electron": ">=11.1.0"
12+
"electron": ">=11.1.0",
13+
"iohook": "^0.9.2"
1414
}
1515
}

examples/electron-renderer-example/index.html renamed to examples/electron-renderer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
process.versions[type];
1212
}
1313

14-
const ioHook = require('../../index');
14+
const ioHook = require('iohook');
1515
ioHook.start(true);
1616
ioHook.on('mouseclick', eventHandler);
1717
ioHook.on('keydown', eventHandler);

0 commit comments

Comments
 (0)