Skip to content

Commit 54af52a

Browse files
committed
Merge branch 'release/v2.1.1'
2 parents d48984f + dda0761 commit 54af52a

39 files changed

+1546
-1130
lines changed

.build/pre-release.ps1

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"//registry.npmjs.org/:_authToken=$env:NPM_TOKEN`n" | out-file "$env:userprofile\.npmrc" -Encoding ASCII
2+
npm whoami
3+
4+
$timestamp = Get-Date -Format yyyyMMddhhmmss
5+
$patchVersion = (npm --no-git-tag version patch)
6+
$nextVersion = "${patchVersion}-next.${timestamp}".Substring(1)
7+
echo $nextVersion
8+
9+
npm version --no-git-tag -f $nextVersion
10+
npm run publish:next

.build/pre-release.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
5+
npm whoami
6+
7+
patchVersion=$(npm --no-git-tag version patch)
8+
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
9+
echo "${nextVersion:1}"
10+
11+
npm version --no-git-tag -f "${nextVersion:1}"
12+
npm run publish:next

.github/workflows/ci.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- develop
6+
- release/**
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ ubuntu-latest, windows-latest, macos-latest ]
14+
node: [ 10, 12, 14 ]
15+
runs-on: ${{matrix.os}}
16+
steps:
17+
- name: Set up Git repository
18+
uses: actions/checkout@v2
19+
- name: Set up node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{matrix.node}}
23+
- name: Configure Linux environment
24+
if: ${{matrix.os == 'ubuntu-latest'}}
25+
run: |
26+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
27+
export CXX=g++-4.8 && $CXX --version
28+
- name: Install
29+
run: npm run patch && npm i
30+
- name: Build
31+
run: npm run build:release
32+
- name: Run tests
33+
uses: GabrielBB/xvfb-action@v1
34+
with:
35+
working-directory: ./test/
36+
run: npm cit
37+
- name: Run window tests
38+
uses: GabrielBB/xvfb-action@v1
39+
with:
40+
working-directory: ./test/window-integration-tests
41+
run: npm cit
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Create snapshot release
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, windows-latest, macos-latest ]
12+
runs-on: ${{matrix.os}}
13+
steps:
14+
- name: Set up Git repository
15+
uses: actions/checkout@v2
16+
- name: Set up node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{matrix.node}}
20+
- name: Configure Linux environment
21+
if: ${{matrix.os == 'ubuntu-latest'}}
22+
run: |
23+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
24+
export CXX=g++-4.8 && $CXX --version
25+
- name: Install
26+
run: npm run patch && npm i
27+
- name: Build
28+
run: npm run build:release
29+
- name: Run tests
30+
uses: GabrielBB/xvfb-action@v1
31+
with:
32+
working-directory: ./test/
33+
run: npm cit
34+
- name: Run window tests
35+
uses: GabrielBB/xvfb-action@v1
36+
with:
37+
working-directory: ./test/window-integration-tests
38+
run: npm cit
39+
40+
deploy:
41+
needs:
42+
- test
43+
strategy:
44+
matrix:
45+
os: [ ubuntu-latest, windows-latest, macos-latest ]
46+
runs-on: ${{matrix.os}}
47+
steps:
48+
- name: Set up Git repository
49+
uses: actions/checkout@v2
50+
- name: Set up node
51+
uses: actions/setup-node@v2
52+
with:
53+
node-version: 14
54+
- name: Configure Linux environment
55+
if: ${{matrix.os == 'ubuntu-latest'}}
56+
run: |
57+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
58+
export CXX=g++-4.8 && $CXX --version
59+
- name: Install
60+
run: npm run patch && npm i
61+
- name: Publish snapshot release
62+
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'}}
63+
run: ./.build/pre-release.sh
64+
shell: bash
65+
env:
66+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67+
- name: Publish Windows snapshot release
68+
if: ${{matrix.os == 'windows-latest'}}
69+
run: ./.build/pre-release.ps1
70+
shell: powershell
71+
env:
72+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
74+
dispatch:
75+
needs:
76+
- deploy
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Dispatch snapshot release
80+
uses: peter-evans/repository-dispatch@v1
81+
with:
82+
token: ${{ secrets.SNAPSHOT_DISPATCH_TOKEN }}
83+
repository: nut-tree/libnut-install
84+
event-type: snapshot-release

.github/workflows/tagged_release.yaml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Create tagged release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, windows-latest, macos-latest ]
12+
node: [ 10, 12, 14 ]
13+
runs-on: ${{matrix.os}}
14+
steps:
15+
- name: Set up Git repository
16+
uses: actions/checkout@v2
17+
- name: Set up node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{matrix.node}}
21+
- name: Configure Linux environment
22+
if: ${{matrix.os == 'ubuntu-latest'}}
23+
run: |
24+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
25+
export CXX=g++-4.8 && $CXX --version
26+
- name: Install
27+
run: npm run patch && npm i
28+
- name: Build
29+
run: npm run build:release
30+
- name: Run tests
31+
uses: GabrielBB/xvfb-action@v1
32+
with:
33+
working-directory: ./test/
34+
run: npm cit
35+
- name: Run window tests
36+
uses: GabrielBB/xvfb-action@v1
37+
with:
38+
working-directory: ./test/window-integration-tests
39+
run: npm cit
40+
41+
deploy:
42+
needs:
43+
- test
44+
strategy:
45+
matrix:
46+
os: [ ubuntu-latest, windows-latest, macos-latest ]
47+
runs-on: ${{matrix.os}}
48+
steps:
49+
- name: Set up Git repository
50+
uses: actions/checkout@v2
51+
- name: Set up node
52+
uses: actions/setup-node@v2
53+
with:
54+
node-version: 14
55+
- name: Configure Linux environment
56+
if: ${{matrix.os == 'ubuntu-latest'}}
57+
run: |
58+
sudo apt-get install -y cmake libx11-dev zlib1g-dev libpng-dev libxtst-dev g++-4.8 gcc-4.8
59+
export CXX=g++-4.8 && $CXX --version
60+
- name: Install
61+
run: npm run patch && npm i
62+
- name: Publish tagged release
63+
uses: JS-DevTools/npm-publish@v1
64+
with:
65+
token: ${{ secrets.NPM_TOKEN }}

.travis.yml

-56
This file was deleted.

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 2.1.1
6+
7+
- Enhancement: Snapshot releases [(#4)](https://github.com/nut-tree/libnut/issues/4)
8+
- Enhancement: Update CI configs [(#7)](https://github.com/nut-tree/libnut/issues/7)
9+
- Enhancement: Split OS specific implementation into separate files [(#20)](https://github.com/nut-tree/libnut/issues/20)
10+
- Enhancement: Linux: Update XGetMainDisplay to avoid receiving `Invalid MIT-MAGIC-COOKIE-1 key` [(#27)](https://github.com/nut-tree/libnut/issues/27)
11+
- Enhancement: Enable GitHub Actions [(#40)](https://github.com/nut-tree/libnut/issues/40)
12+
- Enhancement: Trigger snapshot build for https://github.com/nut-tree/libnut-install after snapshot release [(#42)](https://github.com/nut-tree/libnut/issues/42)
13+
- Bugfix: Region captures can't capture the whole screen [(#45)](https://github.com/nut-tree/libnut/issues/45)
14+
515
## 2.1.0
616

717
- Enhancement: Retrieve coordinates of current active window [(#15)](https://github.com/nut-tree/libnut/issues/15)

CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.12)
22
set(CMAKE_CXX_STANDARD 17)
33

44
project(libnut)
55

66
# Source
7-
set(SOURCE_FILES "src/main.cc" "src/deadbeef_rand.c" "src/keycode.c" "src/keypress.c" "src/MMBitmap.c" "src/mouse.c" "src/screen.c" "src/screengrab.c")
7+
set(SOURCE_FILES "src/main.cc" "src/deadbeef_rand.c" "src/MMBitmap.c")
88
if (UNIX AND NOT APPLE)
9-
set(SOURCE_FILES "${SOURCE_FILES}" "src/linux/xdisplay.c" "src/linux/highlightwindow.c" "src/linux/window_manager.cc")
9+
set(SOURCE_FILES "${SOURCE_FILES}" "src/linux/keycode.c" "src/linux/keypress.c" "src/linux/mouse.c" "src/linux/screen.c" "src/linux/screengrab.c" "src/linux/xdisplay.c" "src/linux/highlightwindow.c" "src/linux/window_manager.cc")
1010
elseif (UNIX AND APPLE)
11-
set(SOURCE_FILES "${SOURCE_FILES}" "src/macos/highlightwindow.m" "src/macos/window_manager.mm")
11+
set(SOURCE_FILES "${SOURCE_FILES}" "src/macos/keycode.c" "src/macos/keypress.c" "src/macos/mouse.c" "src/macos/screen.c" "src/macos/screengrab.c" "src/macos/highlightwindow.m" "src/macos/window_manager.mm")
1212
elseif (WIN32)
13-
set(SOURCE_FILES "${SOURCE_FILES}" "src/win32/highlightwindow.c" "src/win32/window_manager.cc")
13+
set(SOURCE_FILES "${SOURCE_FILES}" "src/win32/keycode.c" "src/win32/keypress.c" "src/win32/mouse.c" "src/win32/screen.c" "src/win32/screengrab.c" "src/win32/highlightwindow.c" "src/win32/window_manager.cc")
1414
endif()
1515
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
1616

README.md

-14
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,9 @@ npm install
2222
npm run build:release
2323
```
2424

25-
Installation and build on Windows
26-
27-
```
28-
npm install
29-
npm run build:release:win
30-
```
31-
3225
### Debug build
3326

3427
```
3528
npm install
3629
npm run build:debug
3730
```
38-
39-
Installation and build on Windows
40-
41-
```
42-
npm install
43-
npm run build:debug:win
44-
```

appveyor.yml

-46
This file was deleted.

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)